1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. threatdetection
  5. BackupPolicy
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.threatdetection.BackupPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultAssets = AliCloud.ThreatDetection.GetAssets.Invoke(new()
        {
            MachineTypes = "ecs",
        });
    
        var defaultBackupPolicy = new AliCloud.ThreatDetection.BackupPolicy("defaultBackupPolicy", 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[]
            {
                defaultAssets.Apply(getAssetsResult => getAssetsResult.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 {
    		defaultAssets, err := threatdetection.GetAssets(ctx, &threatdetection.GetAssetsArgs{
    			MachineTypes: pulumi.StringRef("ecs"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = threatdetection.NewBackupPolicy(ctx, "defaultBackupPolicy", &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(defaultAssets.Ids[0]),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 defaultAssets = 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(defaultAssets.applyValue(getAssetsResult -> getAssetsResult.ids()[0]))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_assets = alicloud.threatdetection.get_assets(machine_types="ecs")
    default_backup_policy = alicloud.threatdetection.BackupPolicy("defaultBackupPolicy",
        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_assets.ids[0]])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultAssets = alicloud.threatdetection.getAssets({
        machineTypes: "ecs",
    });
    const defaultBackupPolicy = new alicloud.threatdetection.BackupPolicy("defaultBackupPolicy", {
        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: [defaultAssets.then(defaultAssets => defaultAssets.ids?.[0])],
    });
    
    resources:
      defaultBackupPolicy:
        type: alicloud:threatdetection:BackupPolicy
        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:
            - ${defaultAssets.ids[0]}
    variables:
      defaultAssets:
        fn::invoke:
          Function: alicloud:threatdetection:getAssets
          Arguments:
            machineTypes: ecs
    

    Create BackupPolicy Resource

    new BackupPolicy(name: string, args: BackupPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def BackupPolicy(resource_name: 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,
                     uuid_lists: Optional[Sequence[str]] = None)
    @overload
    def BackupPolicy(resource_name: str,
                     args: BackupPolicyArgs,
                     opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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>
    

    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.45.0 published on Monday, Nov 27, 2023 by Pulumi