1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. threatdetection
  5. getBackupPolicies
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

alicloud.threatdetection.getBackupPolicies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

    This data source provides the Threat Detection Backup Policies of the current Alibaba Cloud user.

    NOTE: Available in v1.195.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.threatdetection.getBackupPolicies({
        ids: ["example_id"],
    });
    export const threatDetectionBackupPoliciesId1 = ids.then(ids => ids.policies?.[0]?.id);
    const nameRegex = alicloud.threatdetection.getBackupPolicies({
        nameRegex: "tf-example",
    });
    export const threatDetectionBackupPoliciesId2 = nameRegex.then(nameRegex => nameRegex.policies?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.threatdetection.get_backup_policies(ids=["example_id"])
    pulumi.export("threatDetectionBackupPoliciesId1", ids.policies[0].id)
    name_regex = alicloud.threatdetection.get_backup_policies(name_regex="tf-example")
    pulumi.export("threatDetectionBackupPoliciesId2", name_regex.policies[0].id)
    
    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 {
    		ids, err := threatdetection.GetBackupPolicies(ctx, &threatdetection.GetBackupPoliciesArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("threatDetectionBackupPoliciesId1", ids.Policies[0].Id)
    		nameRegex, err := threatdetection.GetBackupPolicies(ctx, &threatdetection.GetBackupPoliciesArgs{
    			NameRegex: pulumi.StringRef("tf-example"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("threatDetectionBackupPoliciesId2", nameRegex.Policies[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.ThreatDetection.GetBackupPolicies.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.ThreatDetection.GetBackupPolicies.Invoke(new()
        {
            NameRegex = "tf-example",
        });
    
        return new Dictionary<string, object?>
        {
            ["threatDetectionBackupPoliciesId1"] = ids.Apply(getBackupPoliciesResult => getBackupPoliciesResult.Policies[0]?.Id),
            ["threatDetectionBackupPoliciesId2"] = nameRegex.Apply(getBackupPoliciesResult => getBackupPoliciesResult.Policies[0]?.Id),
        };
    });
    
    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.GetBackupPoliciesArgs;
    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 ids = ThreatdetectionFunctions.getBackupPolicies(GetBackupPoliciesArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("threatDetectionBackupPoliciesId1", ids.applyValue(getBackupPoliciesResult -> getBackupPoliciesResult.policies()[0].id()));
            final var nameRegex = ThreatdetectionFunctions.getBackupPolicies(GetBackupPoliciesArgs.builder()
                .nameRegex("tf-example")
                .build());
    
            ctx.export("threatDetectionBackupPoliciesId2", nameRegex.applyValue(getBackupPoliciesResult -> getBackupPoliciesResult.policies()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:threatdetection:getBackupPolicies
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:threatdetection:getBackupPolicies
          Arguments:
            nameRegex: tf-example
    outputs:
      threatDetectionBackupPoliciesId1: ${ids.policies[0].id}
      threatDetectionBackupPoliciesId2: ${nameRegex.policies[0].id}
    

    Using getBackupPolicies

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getBackupPolicies(args: GetBackupPoliciesArgs, opts?: InvokeOptions): Promise<GetBackupPoliciesResult>
    function getBackupPoliciesOutput(args: GetBackupPoliciesOutputArgs, opts?: InvokeOptions): Output<GetBackupPoliciesResult>
    def get_backup_policies(current_page: Optional[int] = None,
                            ids: Optional[Sequence[str]] = None,
                            machine_remark: Optional[str] = None,
                            name: Optional[str] = None,
                            name_regex: Optional[str] = None,
                            output_file: Optional[str] = None,
                            page_size: Optional[int] = None,
                            status: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetBackupPoliciesResult
    def get_backup_policies_output(current_page: Optional[pulumi.Input[int]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            machine_remark: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            name_regex: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            page_size: Optional[pulumi.Input[int]] = None,
                            status: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetBackupPoliciesResult]
    func GetBackupPolicies(ctx *Context, args *GetBackupPoliciesArgs, opts ...InvokeOption) (*GetBackupPoliciesResult, error)
    func GetBackupPoliciesOutput(ctx *Context, args *GetBackupPoliciesOutputArgs, opts ...InvokeOption) GetBackupPoliciesResultOutput

    > Note: This function is named GetBackupPolicies in the Go SDK.

    public static class GetBackupPolicies 
    {
        public static Task<GetBackupPoliciesResult> InvokeAsync(GetBackupPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetBackupPoliciesResult> Invoke(GetBackupPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackupPoliciesResult> getBackupPolicies(GetBackupPoliciesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:threatdetection/getBackupPolicies:getBackupPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CurrentPage int
    Ids List<string>
    A list of Threat Detection Backup Policies IDs.
    MachineRemark string
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    Name string
    The name of the anti-ransomware policy that you want to query.
    NameRegex string
    A regex string to filter results by Threat Detection Backup Policies name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageSize int
    Status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    CurrentPage int
    Ids []string
    A list of Threat Detection Backup Policies IDs.
    MachineRemark string
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    Name string
    The name of the anti-ransomware policy that you want to query.
    NameRegex string
    A regex string to filter results by Threat Detection Backup Policies name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageSize int
    Status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    currentPage Integer
    ids List<String>
    A list of Threat Detection Backup Policies IDs.
    machineRemark String
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    name String
    The name of the anti-ransomware policy that you want to query.
    nameRegex String
    A regex string to filter results by Threat Detection Backup Policies name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageSize Integer
    status String
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    currentPage number
    ids string[]
    A list of Threat Detection Backup Policies IDs.
    machineRemark string
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    name string
    The name of the anti-ransomware policy that you want to query.
    nameRegex string
    A regex string to filter results by Threat Detection Backup Policies name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageSize number
    status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    current_page int
    ids Sequence[str]
    A list of Threat Detection Backup Policies IDs.
    machine_remark str
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    name str
    The name of the anti-ransomware policy that you want to query.
    name_regex str
    A regex string to filter results by Threat Detection Backup Policies name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_size int
    status str
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    currentPage Number
    ids List<String>
    A list of Threat Detection Backup Policies IDs.
    machineRemark String
    The information that you want to use to identify the servers protected by the anti-ransomware policy. You can enter the IP address or ID of a server.
    name String
    The name of the anti-ransomware policy that you want to query.
    nameRegex String
    A regex string to filter results by Threat Detection Backup Policies name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageSize Number
    status String
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.

    getBackupPolicies Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Threat Detection Backup Policy names.
    Policies List<Pulumi.AliCloud.ThreatDetection.Outputs.GetBackupPoliciesPolicy>
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    CurrentPage int
    MachineRemark string
    Name string
    NameRegex string
    OutputFile string
    PageSize int
    Status string
    The status of the anti-ransomware policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Threat Detection Backup Policy names.
    Policies []GetBackupPoliciesPolicy
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    CurrentPage int
    MachineRemark string
    Name string
    NameRegex string
    OutputFile string
    PageSize int
    Status string
    The status of the anti-ransomware policy.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Threat Detection Backup Policy names.
    policies List<GetBackupPoliciesPolicy>
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    currentPage Integer
    machineRemark String
    name String
    nameRegex String
    outputFile String
    pageSize Integer
    status String
    The status of the anti-ransomware policy.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Threat Detection Backup Policy names.
    policies GetBackupPoliciesPolicy[]
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    currentPage number
    machineRemark string
    name string
    nameRegex string
    outputFile string
    pageSize number
    status string
    The status of the anti-ransomware policy.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Threat Detection Backup Policy names.
    policies Sequence[GetBackupPoliciesPolicy]
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    current_page int
    machine_remark str
    name str
    name_regex str
    output_file str
    page_size int
    status str
    The status of the anti-ransomware policy.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Threat Detection Backup Policy names.
    policies List<Property Map>
    A list of Threat Detection Backup policies. Each element contains the following attributes:
    currentPage Number
    machineRemark String
    name String
    nameRegex String
    outputFile String
    pageSize Number
    status String
    The status of the anti-ransomware policy.

    Supporting Types

    GetBackupPoliciesPolicy

    BackupPolicyId int
    The ID of the anti-ransomware policy.
    BackupPolicyName string
    The name of the anti-ransomware policy.
    Id int
    The ID of the anti-ransomware policy.
    Policy string
    The configurations of the anti-ransomware policy.
    PolicyRegionId string
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    PolicyVersion string
    The version of the anti-ransomware policy.
    Status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    UuidLists List<string>
    The UUIDs of the servers to which the anti-ransomware policy is applied.
    BackupPolicyId int
    The ID of the anti-ransomware policy.
    BackupPolicyName string
    The name of the anti-ransomware policy.
    Id int
    The ID of the anti-ransomware policy.
    Policy string
    The configurations of the anti-ransomware policy.
    PolicyRegionId string
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    PolicyVersion string
    The version of the anti-ransomware policy.
    Status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    UuidLists []string
    The UUIDs of the servers to which the anti-ransomware policy is applied.
    backupPolicyId Integer
    The ID of the anti-ransomware policy.
    backupPolicyName String
    The name of the anti-ransomware policy.
    id Integer
    The ID of the anti-ransomware policy.
    policy String
    The configurations of the anti-ransomware policy.
    policyRegionId String
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    policyVersion String
    The version of the anti-ransomware policy.
    status String
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    uuidLists List<String>
    The UUIDs of the servers to which the anti-ransomware policy is applied.
    backupPolicyId number
    The ID of the anti-ransomware policy.
    backupPolicyName string
    The name of the anti-ransomware policy.
    id number
    The ID of the anti-ransomware policy.
    policy string
    The configurations of the anti-ransomware policy.
    policyRegionId string
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    policyVersion string
    The version of the anti-ransomware policy.
    status string
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    uuidLists string[]
    The UUIDs of the servers to which the anti-ransomware policy is applied.
    backup_policy_id int
    The ID of the anti-ransomware policy.
    backup_policy_name str
    The name of the anti-ransomware policy.
    id int
    The ID of the anti-ransomware policy.
    policy str
    The configurations of the anti-ransomware policy.
    policy_region_id str
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    policy_version str
    The version of the anti-ransomware policy.
    status str
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    uuid_lists Sequence[str]
    The UUIDs of the servers to which the anti-ransomware policy is applied.
    backupPolicyId Number
    The ID of the anti-ransomware policy.
    backupPolicyName String
    The name of the anti-ransomware policy.
    id Number
    The ID of the anti-ransomware policy.
    policy String
    The configurations of the anti-ransomware policy.
    policyRegionId String
    The ID of the region that you specified for data backup when you installed the anti-ransomware agent for the server not deployed on Alibaba Cloud.
    policyVersion String
    The version of the anti-ransomware policy.
    status String
    The status of the anti-ransomware policy. Valid Value: enabled, disabled, closed.
    uuidLists List<String>
    The UUIDs of the servers to which the anti-ransomware policy is applied.

    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.59.0 published on Friday, Jul 12, 2024 by Pulumi