1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. threatdetection
  5. BackupPolicy
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.threatdetection.BackupPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Threat Detection Backup Policy resource.

    For information about Threat Detection Backup Policy and how to use it, see What is Backup Policy.

    NOTE: Available in v1.195.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.threatdetection.getAssets({
        machineTypes: "ecs",
    });
    const defaultBackupPolicy = new alicloud.threatdetection.BackupPolicy("default", {
        backupPolicyName: "tf-example-name",
        policy: "{\"Exclude\":[\"/bin/\",\"/usr/bin/\",\"/sbin/\",\"/boot/\",\"/proc/\",\"/sys/\",\"/srv/\",\"/lib/\",\"/selinux/\",\"/usr/sbin/\",\"/run/\",\"/lib32/\",\"/lib64/\",\"/lost+found/\",\"/var/lib/kubelet/\",\"/var/lib/ntp/proc\",\"/var/lib/container\"],\"ExcludeSystemPath\":true,\"Include\":[],\"IsDefault\":1,\"Retention\":7,\"Schedule\":\"I|1668703620|PT24H\",\"Source\":[],\"SpeedLimiter\":\"\",\"UseVss\":true}",
        policyVersion: "2.0.0",
        uuidLists: [_default.then(_default => _default.ids?.[0])],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.threatdetection.get_assets(machine_types="ecs")
    default_backup_policy = alicloud.threatdetection.BackupPolicy("default",
        backup_policy_name="tf-example-name",
        policy="{\"Exclude\":[\"/bin/\",\"/usr/bin/\",\"/sbin/\",\"/boot/\",\"/proc/\",\"/sys/\",\"/srv/\",\"/lib/\",\"/selinux/\",\"/usr/sbin/\",\"/run/\",\"/lib32/\",\"/lib64/\",\"/lost+found/\",\"/var/lib/kubelet/\",\"/var/lib/ntp/proc\",\"/var/lib/container\"],\"ExcludeSystemPath\":true,\"Include\":[],\"IsDefault\":1,\"Retention\":7,\"Schedule\":\"I|1668703620|PT24H\",\"Source\":[],\"SpeedLimiter\":\"\",\"UseVss\":true}",
        policy_version="2.0.0",
        uuid_lists=[default.ids[0]])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := threatdetection.GetAssets(ctx, &threatdetection.GetAssetsArgs{
    			MachineTypes: pulumi.StringRef("ecs"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = threatdetection.NewBackupPolicy(ctx, "default", &threatdetection.BackupPolicyArgs{
    			BackupPolicyName: pulumi.String("tf-example-name"),
    			Policy:           pulumi.String("{\"Exclude\":[\"/bin/\",\"/usr/bin/\",\"/sbin/\",\"/boot/\",\"/proc/\",\"/sys/\",\"/srv/\",\"/lib/\",\"/selinux/\",\"/usr/sbin/\",\"/run/\",\"/lib32/\",\"/lib64/\",\"/lost+found/\",\"/var/lib/kubelet/\",\"/var/lib/ntp/proc\",\"/var/lib/container\"],\"ExcludeSystemPath\":true,\"Include\":[],\"IsDefault\":1,\"Retention\":7,\"Schedule\":\"I|1668703620|PT24H\",\"Source\":[],\"SpeedLimiter\":\"\",\"UseVss\":true}"),
    			PolicyVersion:    pulumi.String("2.0.0"),
    			UuidLists: pulumi.StringArray{
    				pulumi.String(_default.Ids[0]),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.ThreatDetection.GetAssets.Invoke(new()
        {
            MachineTypes = "ecs",
        });
    
        var defaultBackupPolicy = new AliCloud.ThreatDetection.BackupPolicy("default", new()
        {
            BackupPolicyName = "tf-example-name",
            Policy = "{\"Exclude\":[\"/bin/\",\"/usr/bin/\",\"/sbin/\",\"/boot/\",\"/proc/\",\"/sys/\",\"/srv/\",\"/lib/\",\"/selinux/\",\"/usr/sbin/\",\"/run/\",\"/lib32/\",\"/lib64/\",\"/lost+found/\",\"/var/lib/kubelet/\",\"/var/lib/ntp/proc\",\"/var/lib/container\"],\"ExcludeSystemPath\":true,\"Include\":[],\"IsDefault\":1,\"Retention\":7,\"Schedule\":\"I|1668703620|PT24H\",\"Source\":[],\"SpeedLimiter\":\"\",\"UseVss\":true}",
            PolicyVersion = "2.0.0",
            UuidLists = new[]
            {
                @default.Apply(@default => @default.Apply(getAssetsResult => getAssetsResult.Ids[0])),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.threatdetection.ThreatdetectionFunctions;
    import com.pulumi.alicloud.threatdetection.inputs.GetAssetsArgs;
    import com.pulumi.alicloud.threatdetection.BackupPolicy;
    import com.pulumi.alicloud.threatdetection.BackupPolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var default = ThreatdetectionFunctions.getAssets(GetAssetsArgs.builder()
                .machineTypes("ecs")
                .build());
    
            var defaultBackupPolicy = new BackupPolicy("defaultBackupPolicy", BackupPolicyArgs.builder()
                .backupPolicyName("tf-example-name")
                .policy("{\"Exclude\":[\"/bin/\",\"/usr/bin/\",\"/sbin/\",\"/boot/\",\"/proc/\",\"/sys/\",\"/srv/\",\"/lib/\",\"/selinux/\",\"/usr/sbin/\",\"/run/\",\"/lib32/\",\"/lib64/\",\"/lost+found/\",\"/var/lib/kubelet/\",\"/var/lib/ntp/proc\",\"/var/lib/container\"],\"ExcludeSystemPath\":true,\"Include\":[],\"IsDefault\":1,\"Retention\":7,\"Schedule\":\"I|1668703620|PT24H\",\"Source\":[],\"SpeedLimiter\":\"\",\"UseVss\":true}")
                .policyVersion("2.0.0")
                .uuidLists(default_.ids()[0])
                .build());
    
        }
    }
    
    resources:
      defaultBackupPolicy:
        type: alicloud:threatdetection:BackupPolicy
        name: default
        properties:
          backupPolicyName: tf-example-name
          policy: '{"Exclude":["/bin/","/usr/bin/","/sbin/","/boot/","/proc/","/sys/","/srv/","/lib/","/selinux/","/usr/sbin/","/run/","/lib32/","/lib64/","/lost+found/","/var/lib/kubelet/","/var/lib/ntp/proc","/var/lib/container"],"ExcludeSystemPath":true,"Include":[],"IsDefault":1,"Retention":7,"Schedule":"I|1668703620|PT24H","Source":[],"SpeedLimiter":"","UseVss":true}'
          policyVersion: 2.0.0
          uuidLists:
            - ${default.ids[0]}
    variables:
      default:
        fn::invoke:
          Function: alicloud:threatdetection:getAssets
          Arguments:
            machineTypes: ecs
    

    Create BackupPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def BackupPolicy(resource_name: str,
                     args: BackupPolicyArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BackupPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     backup_policy_name: Optional[str] = None,
                     policy: Optional[str] = None,
                     policy_version: Optional[str] = None,
                     uuid_lists: Optional[Sequence[str]] = None,
                     policy_region_id: Optional[str] = None)
    func NewBackupPolicy(ctx *Context, name string, args BackupPolicyArgs, opts ...ResourceOption) (*BackupPolicy, error)
    public BackupPolicy(string name, BackupPolicyArgs args, CustomResourceOptions? opts = null)
    public BackupPolicy(String name, BackupPolicyArgs args)
    public BackupPolicy(String name, BackupPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:threatdetection:BackupPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BackupPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy = new AliCloud.ThreatDetection.BackupPolicy("examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy", new()
    {
        BackupPolicyName = "string",
        Policy = "string",
        PolicyVersion = "string",
        UuidLists = new[]
        {
            "string",
        },
        PolicyRegionId = "string",
    });
    
    example, err := threatdetection.NewBackupPolicy(ctx, "examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy", &threatdetection.BackupPolicyArgs{
    	BackupPolicyName: pulumi.String("string"),
    	Policy:           pulumi.String("string"),
    	PolicyVersion:    pulumi.String("string"),
    	UuidLists: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	PolicyRegionId: pulumi.String("string"),
    })
    
    var examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy = new BackupPolicy("examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy", BackupPolicyArgs.builder()
        .backupPolicyName("string")
        .policy("string")
        .policyVersion("string")
        .uuidLists("string")
        .policyRegionId("string")
        .build());
    
    examplebackup_policy_resource_resource_from_threatdetectionbackup_policy = alicloud.threatdetection.BackupPolicy("examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy",
        backup_policy_name="string",
        policy="string",
        policy_version="string",
        uuid_lists=["string"],
        policy_region_id="string")
    
    const examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy = new alicloud.threatdetection.BackupPolicy("examplebackupPolicyResourceResourceFromThreatdetectionbackupPolicy", {
        backupPolicyName: "string",
        policy: "string",
        policyVersion: "string",
        uuidLists: ["string"],
        policyRegionId: "string",
    });
    
    type: alicloud:threatdetection:BackupPolicy
    properties:
        backupPolicyName: string
        policy: string
        policyRegionId: string
        policyVersion: string
        uuidLists:
            - string
    

    BackupPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The BackupPolicy resource accepts the following input properties:

    BackupPolicyName string
    Protection of the Name of the Policy.
    Policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    PolicyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    UuidLists List<string>
    Specify the Protection of Server UUID List.
    PolicyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    BackupPolicyName string
    Protection of the Name of the Policy.
    Policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    PolicyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    UuidLists []string
    Specify the Protection of Server UUID List.
    PolicyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    backupPolicyName String
    Protection of the Name of the Policy.
    policy String
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyVersion String
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    uuidLists List<String>
    Specify the Protection of Server UUID List.
    policyRegionId String
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    backupPolicyName string
    Protection of the Name of the Policy.
    policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    uuidLists string[]
    Specify the Protection of Server UUID List.
    policyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    backup_policy_name str
    Protection of the Name of the Policy.
    policy str
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policy_version str
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    uuid_lists Sequence[str]
    Specify the Protection of Server UUID List.
    policy_region_id str
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    backupPolicyName String
    Protection of the Name of the Policy.
    policy String
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyVersion String
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    uuidLists List<String>
    Specify the Protection of Server UUID List.
    policyRegionId String
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BackupPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Backup Policy instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Backup Policy instance.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Backup Policy instance.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the Backup Policy instance.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the Backup Policy instance.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Backup Policy instance.

    Look up Existing BackupPolicy Resource

    Get an existing BackupPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BackupPolicyState, opts?: CustomResourceOptions): BackupPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backup_policy_name: Optional[str] = None,
            policy: Optional[str] = None,
            policy_region_id: Optional[str] = None,
            policy_version: Optional[str] = None,
            status: Optional[str] = None,
            uuid_lists: Optional[Sequence[str]] = None) -> BackupPolicy
    func GetBackupPolicy(ctx *Context, name string, id IDInput, state *BackupPolicyState, opts ...ResourceOption) (*BackupPolicy, error)
    public static BackupPolicy Get(string name, Input<string> id, BackupPolicyState? state, CustomResourceOptions? opts = null)
    public static BackupPolicy get(String name, Output<String> id, BackupPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BackupPolicyName string
    Protection of the Name of the Policy.
    Policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    PolicyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    PolicyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    Status string
    The status of the Backup Policy instance.
    UuidLists List<string>
    Specify the Protection of Server UUID List.
    BackupPolicyName string
    Protection of the Name of the Policy.
    Policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    PolicyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    PolicyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    Status string
    The status of the Backup Policy instance.
    UuidLists []string
    Specify the Protection of Server UUID List.
    backupPolicyName String
    Protection of the Name of the Policy.
    policy String
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyRegionId String
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    policyVersion String
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    status String
    The status of the Backup Policy instance.
    uuidLists List<String>
    Specify the Protection of Server UUID List.
    backupPolicyName string
    Protection of the Name of the Policy.
    policy string
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyRegionId string
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    policyVersion string
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    status string
    The status of the Backup Policy instance.
    uuidLists string[]
    Specify the Protection of Server UUID List.
    backup_policy_name str
    Protection of the Name of the Policy.
    policy str
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policy_region_id str
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    policy_version str
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    status str
    The status of the Backup Policy instance.
    uuid_lists Sequence[str]
    Specify the Protection of Server UUID List.
    backupPolicyName String
    Protection of the Name of the Policy.
    policy String
    The Specified Protection Policies of the Specific Configuration. see how to use it.
    policyRegionId String
    The region ID of the non-Alibaba cloud server. You can call the DescribeSupportRegion interface to view the region supported by anti-ransomware, and then select the region supported by anti-ransomware according to the region where your non-Alibaba cloud server is located.
    policyVersion String
    Anti-Blackmail Policy Version. Valid values: 1.0.0, 2.0.0.
    status String
    The status of the Backup Policy instance.
    uuidLists List<String>
    Specify the Protection of Server UUID List.

    Import

    Threat Detection Backup Policy can be imported using the id, e.g.

    $ pulumi import alicloud:threatdetection/backupPolicy:BackupPolicy example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi