AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

Selection

Manages selection conditions for AWS Backup plan resources.

Example Usage

IAM Role

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleRole = new Aws.Iam.Role("exampleRole", new()
    {
        AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Action"": [""sts:AssumeRole""],
      ""Effect"": ""allow"",
      ""Principal"": {
        ""Service"": [""backup.amazonaws.com""]
      }
    }
  ]
}
",
    });

    var exampleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("exampleRolePolicyAttachment", new()
    {
        PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup",
        Role = exampleRole.Name,
    });

    // ... other configuration ...
    var exampleSelection = new Aws.Backup.Selection("exampleSelection", new()
    {
        IamRoleArn = exampleRole.Arn,
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/backup"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleRole, err := iam.NewRole(ctx, "exampleRole", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf(`{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["sts:AssumeRole"],
      "Effect": "allow",
      "Principal": {
        "Service": ["backup.amazonaws.com"]
      }
    }
  ]
}
`)),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicyAttachment(ctx, "exampleRolePolicyAttachment", &iam.RolePolicyAttachmentArgs{
			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup"),
			Role:      exampleRole.Name,
		})
		if err != nil {
			return err
		}
		_, err = backup.NewSelection(ctx, "exampleSelection", &backup.SelectionArgs{
			IamRoleArn: exampleRole.Arn,
		})
		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.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import com.pulumi.aws.backup.Selection;
import com.pulumi.aws.backup.SelectionArgs;
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) {
        var exampleRole = new Role("exampleRole", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["sts:AssumeRole"],
      "Effect": "allow",
      "Principal": {
        "Service": ["backup.amazonaws.com"]
      }
    }
  ]
}
            """)
            .build());

        var exampleRolePolicyAttachment = new RolePolicyAttachment("exampleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()        
            .policyArn("arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup")
            .role(exampleRole.name())
            .build());

        var exampleSelection = new Selection("exampleSelection", SelectionArgs.builder()        
            .iamRoleArn(exampleRole.arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_role = aws.iam.Role("exampleRole", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["sts:AssumeRole"],
      "Effect": "allow",
      "Principal": {
        "Service": ["backup.amazonaws.com"]
      }
    }
  ]
}
""")
example_role_policy_attachment = aws.iam.RolePolicyAttachment("exampleRolePolicyAttachment",
    policy_arn="arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup",
    role=example_role.name)
# ... other configuration ...
example_selection = aws.backup.Selection("exampleSelection", iam_role_arn=example_role.arn)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleRole = new aws.iam.Role("exampleRole", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["sts:AssumeRole"],
      "Effect": "allow",
      "Principal": {
        "Service": ["backup.amazonaws.com"]
      }
    }
  ]
}
`});
const exampleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("exampleRolePolicyAttachment", {
    policyArn: "arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup",
    role: exampleRole.name,
});
// ... other configuration ...
const exampleSelection = new aws.backup.Selection("exampleSelection", {iamRoleArn: exampleRole.arn});
resources:
  exampleRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: |
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Action": ["sts:AssumeRole"],
              "Effect": "allow",
              "Principal": {
                "Service": ["backup.amazonaws.com"]
              }
            }
          ]
        }        
  exampleRolePolicyAttachment:
    type: aws:iam:RolePolicyAttachment
    properties:
      policyArn: arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup
      role: ${exampleRole.name}
  exampleSelection:
    type: aws:backup:Selection
    properties:
      iamRoleArn: ${exampleRole.arn}

Selecting Backups By Tag

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Backup.Selection("example", new()
    {
        IamRoleArn = aws_iam_role.Example.Arn,
        PlanId = aws_backup_plan.Example.Id,
        SelectionTags = new[]
        {
            new Aws.Backup.Inputs.SelectionSelectionTagArgs
            {
                Type = "STRINGEQUALS",
                Key = "foo",
                Value = "bar",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/backup"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewSelection(ctx, "example", &backup.SelectionArgs{
			IamRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
			PlanId:     pulumi.Any(aws_backup_plan.Example.Id),
			SelectionTags: backup.SelectionSelectionTagArray{
				&backup.SelectionSelectionTagArgs{
					Type:  pulumi.String("STRINGEQUALS"),
					Key:   pulumi.String("foo"),
					Value: pulumi.String("bar"),
				},
			},
		})
		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.aws.backup.Selection;
import com.pulumi.aws.backup.SelectionArgs;
import com.pulumi.aws.backup.inputs.SelectionSelectionTagArgs;
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) {
        var example = new Selection("example", SelectionArgs.builder()        
            .iamRoleArn(aws_iam_role.example().arn())
            .planId(aws_backup_plan.example().id())
            .selectionTags(SelectionSelectionTagArgs.builder()
                .type("STRINGEQUALS")
                .key("foo")
                .value("bar")
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.backup.Selection("example",
    iam_role_arn=aws_iam_role["example"]["arn"],
    plan_id=aws_backup_plan["example"]["id"],
    selection_tags=[aws.backup.SelectionSelectionTagArgs(
        type="STRINGEQUALS",
        key="foo",
        value="bar",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.Selection("example", {
    iamRoleArn: aws_iam_role.example.arn,
    planId: aws_backup_plan.example.id,
    selectionTags: [{
        type: "STRINGEQUALS",
        key: "foo",
        value: "bar",
    }],
});
resources:
  example:
    type: aws:backup:Selection
    properties:
      iamRoleArn: ${aws_iam_role.example.arn}
      planId: ${aws_backup_plan.example.id}
      selectionTags:
        - type: STRINGEQUALS
          key: foo
          value: bar

Selecting Backups By Conditions

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Backup.Selection("example", new()
    {
        IamRoleArn = aws_iam_role.Example.Arn,
        PlanId = aws_backup_plan.Example.Id,
        Resources = new[]
        {
            "*",
        },
        Conditions = new[]
        {
            new Aws.Backup.Inputs.SelectionConditionArgs
            {
                StringEquals = new[]
                {
                    new Aws.Backup.Inputs.SelectionConditionStringEqualArgs
                    {
                        Key = "aws:ResourceTag/Component",
                        Value = "rds",
                    },
                },
                StringLikes = new[]
                {
                    new Aws.Backup.Inputs.SelectionConditionStringLikeArgs
                    {
                        Key = "aws:ResourceTag/Application",
                        Value = "app*",
                    },
                },
                StringNotEquals = new[]
                {
                    new Aws.Backup.Inputs.SelectionConditionStringNotEqualArgs
                    {
                        Key = "aws:ResourceTag/Backup",
                        Value = "false",
                    },
                },
                StringNotLikes = new[]
                {
                    new Aws.Backup.Inputs.SelectionConditionStringNotLikeArgs
                    {
                        Key = "aws:ResourceTag/Environment",
                        Value = "test*",
                    },
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/backup"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewSelection(ctx, "example", &backup.SelectionArgs{
			IamRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
			PlanId:     pulumi.Any(aws_backup_plan.Example.Id),
			Resources: pulumi.StringArray{
				pulumi.String("*"),
			},
			Conditions: backup.SelectionConditionArray{
				&backup.SelectionConditionArgs{
					StringEquals: backup.SelectionConditionStringEqualArray{
						&backup.SelectionConditionStringEqualArgs{
							Key:   pulumi.String("aws:ResourceTag/Component"),
							Value: pulumi.String("rds"),
						},
					},
					StringLikes: backup.SelectionConditionStringLikeArray{
						&backup.SelectionConditionStringLikeArgs{
							Key:   pulumi.String("aws:ResourceTag/Application"),
							Value: pulumi.String("app*"),
						},
					},
					StringNotEquals: backup.SelectionConditionStringNotEqualArray{
						&backup.SelectionConditionStringNotEqualArgs{
							Key:   pulumi.String("aws:ResourceTag/Backup"),
							Value: pulumi.String("false"),
						},
					},
					StringNotLikes: backup.SelectionConditionStringNotLikeArray{
						&backup.SelectionConditionStringNotLikeArgs{
							Key:   pulumi.String("aws:ResourceTag/Environment"),
							Value: pulumi.String("test*"),
						},
					},
				},
			},
		})
		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.aws.backup.Selection;
import com.pulumi.aws.backup.SelectionArgs;
import com.pulumi.aws.backup.inputs.SelectionConditionArgs;
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) {
        var example = new Selection("example", SelectionArgs.builder()        
            .iamRoleArn(aws_iam_role.example().arn())
            .planId(aws_backup_plan.example().id())
            .resources("*")
            .conditions(SelectionConditionArgs.builder()
                .stringEquals(SelectionConditionStringEqualArgs.builder()
                    .key("aws:ResourceTag/Component")
                    .value("rds")
                    .build())
                .stringLikes(SelectionConditionStringLikeArgs.builder()
                    .key("aws:ResourceTag/Application")
                    .value("app*")
                    .build())
                .stringNotEquals(SelectionConditionStringNotEqualArgs.builder()
                    .key("aws:ResourceTag/Backup")
                    .value("false")
                    .build())
                .stringNotLikes(SelectionConditionStringNotLikeArgs.builder()
                    .key("aws:ResourceTag/Environment")
                    .value("test*")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.backup.Selection("example",
    iam_role_arn=aws_iam_role["example"]["arn"],
    plan_id=aws_backup_plan["example"]["id"],
    resources=["*"],
    conditions=[aws.backup.SelectionConditionArgs(
        string_equals=[aws.backup.SelectionConditionStringEqualArgs(
            key="aws:ResourceTag/Component",
            value="rds",
        )],
        string_likes=[aws.backup.SelectionConditionStringLikeArgs(
            key="aws:ResourceTag/Application",
            value="app*",
        )],
        string_not_equals=[aws.backup.SelectionConditionStringNotEqualArgs(
            key="aws:ResourceTag/Backup",
            value="false",
        )],
        string_not_likes=[aws.backup.SelectionConditionStringNotLikeArgs(
            key="aws:ResourceTag/Environment",
            value="test*",
        )],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.Selection("example", {
    iamRoleArn: aws_iam_role.example.arn,
    planId: aws_backup_plan.example.id,
    resources: ["*"],
    conditions: [{
        stringEquals: [{
            key: "aws:ResourceTag/Component",
            value: "rds",
        }],
        stringLikes: [{
            key: "aws:ResourceTag/Application",
            value: "app*",
        }],
        stringNotEquals: [{
            key: "aws:ResourceTag/Backup",
            value: "false",
        }],
        stringNotLikes: [{
            key: "aws:ResourceTag/Environment",
            value: "test*",
        }],
    }],
});
resources:
  example:
    type: aws:backup:Selection
    properties:
      iamRoleArn: ${aws_iam_role.example.arn}
      planId: ${aws_backup_plan.example.id}
      resources:
        - '*'
      conditions:
        - stringEquals:
            - key: aws:ResourceTag/Component
              value: rds
          stringLikes:
            - key: aws:ResourceTag/Application
              value: app*
          stringNotEquals:
            - key: aws:ResourceTag/Backup
              value: false
          stringNotLikes:
            - key: aws:ResourceTag/Environment
              value: test*

Selecting Backups By Resource

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Backup.Selection("example", new()
    {
        IamRoleArn = aws_iam_role.Example.Arn,
        PlanId = aws_backup_plan.Example.Id,
        Resources = new[]
        {
            aws_db_instance.Example.Arn,
            aws_ebs_volume.Example.Arn,
            aws_efs_file_system.Example.Arn,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/backup"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewSelection(ctx, "example", &backup.SelectionArgs{
			IamRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
			PlanId:     pulumi.Any(aws_backup_plan.Example.Id),
			Resources: pulumi.StringArray{
				pulumi.Any(aws_db_instance.Example.Arn),
				pulumi.Any(aws_ebs_volume.Example.Arn),
				pulumi.Any(aws_efs_file_system.Example.Arn),
			},
		})
		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.aws.backup.Selection;
import com.pulumi.aws.backup.SelectionArgs;
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) {
        var example = new Selection("example", SelectionArgs.builder()        
            .iamRoleArn(aws_iam_role.example().arn())
            .planId(aws_backup_plan.example().id())
            .resources(            
                aws_db_instance.example().arn(),
                aws_ebs_volume.example().arn(),
                aws_efs_file_system.example().arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.backup.Selection("example",
    iam_role_arn=aws_iam_role["example"]["arn"],
    plan_id=aws_backup_plan["example"]["id"],
    resources=[
        aws_db_instance["example"]["arn"],
        aws_ebs_volume["example"]["arn"],
        aws_efs_file_system["example"]["arn"],
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.Selection("example", {
    iamRoleArn: aws_iam_role.example.arn,
    planId: aws_backup_plan.example.id,
    resources: [
        aws_db_instance.example.arn,
        aws_ebs_volume.example.arn,
        aws_efs_file_system.example.arn,
    ],
});
resources:
  example:
    type: aws:backup:Selection
    properties:
      iamRoleArn: ${aws_iam_role.example.arn}
      planId: ${aws_backup_plan.example.id}
      resources:
        - ${aws_db_instance.example.arn}
        - ${aws_ebs_volume.example.arn}
        - ${aws_efs_file_system.example.arn}

Selecting Backups By Not Resource

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Backup.Selection("example", new()
    {
        IamRoleArn = aws_iam_role.Example.Arn,
        PlanId = aws_backup_plan.Example.Id,
        NotResources = new[]
        {
            aws_db_instance.Example.Arn,
            aws_ebs_volume.Example.Arn,
            aws_efs_file_system.Example.Arn,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/backup"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewSelection(ctx, "example", &backup.SelectionArgs{
			IamRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
			PlanId:     pulumi.Any(aws_backup_plan.Example.Id),
			NotResources: pulumi.StringArray{
				pulumi.Any(aws_db_instance.Example.Arn),
				pulumi.Any(aws_ebs_volume.Example.Arn),
				pulumi.Any(aws_efs_file_system.Example.Arn),
			},
		})
		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.aws.backup.Selection;
import com.pulumi.aws.backup.SelectionArgs;
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) {
        var example = new Selection("example", SelectionArgs.builder()        
            .iamRoleArn(aws_iam_role.example().arn())
            .planId(aws_backup_plan.example().id())
            .notResources(            
                aws_db_instance.example().arn(),
                aws_ebs_volume.example().arn(),
                aws_efs_file_system.example().arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.backup.Selection("example",
    iam_role_arn=aws_iam_role["example"]["arn"],
    plan_id=aws_backup_plan["example"]["id"],
    not_resources=[
        aws_db_instance["example"]["arn"],
        aws_ebs_volume["example"]["arn"],
        aws_efs_file_system["example"]["arn"],
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.Selection("example", {
    iamRoleArn: aws_iam_role.example.arn,
    planId: aws_backup_plan.example.id,
    notResources: [
        aws_db_instance.example.arn,
        aws_ebs_volume.example.arn,
        aws_efs_file_system.example.arn,
    ],
});
resources:
  example:
    type: aws:backup:Selection
    properties:
      iamRoleArn: ${aws_iam_role.example.arn}
      planId: ${aws_backup_plan.example.id}
      notResources:
        - ${aws_db_instance.example.arn}
        - ${aws_ebs_volume.example.arn}
        - ${aws_efs_file_system.example.arn}

Create a Selection Resource

new Selection(name: string, args: SelectionArgs, opts?: CustomResourceOptions);
@overload
def Selection(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              conditions: Optional[Sequence[SelectionConditionArgs]] = None,
              iam_role_arn: Optional[str] = None,
              name: Optional[str] = None,
              not_resources: Optional[Sequence[str]] = None,
              plan_id: Optional[str] = None,
              resources: Optional[Sequence[str]] = None,
              selection_tags: Optional[Sequence[SelectionSelectionTagArgs]] = None)
@overload
def Selection(resource_name: str,
              args: SelectionArgs,
              opts: Optional[ResourceOptions] = None)
func NewSelection(ctx *Context, name string, args SelectionArgs, opts ...ResourceOption) (*Selection, error)
public Selection(string name, SelectionArgs args, CustomResourceOptions? opts = null)
public Selection(String name, SelectionArgs args)
public Selection(String name, SelectionArgs args, CustomResourceOptions options)
type: aws:backup:Selection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SelectionArgs
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 SelectionArgs
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 SelectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SelectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SelectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Selection 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 Selection resource accepts the following input properties:

IamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

PlanId string

The backup plan ID to be associated with the selection of resources.

Conditions List<SelectionConditionArgs>

A list of conditions that you define to assign resources to your backup plans using tags.

Name string

The display name of a resource selection document.

NotResources List<string>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

Resources List<string>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

SelectionTags List<SelectionSelectionTagArgs>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

IamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

PlanId string

The backup plan ID to be associated with the selection of resources.

Conditions []SelectionConditionArgs

A list of conditions that you define to assign resources to your backup plans using tags.

Name string

The display name of a resource selection document.

NotResources []string

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

Resources []string

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

SelectionTags []SelectionSelectionTagArgs

Tag-based conditions used to specify a set of resources to assign to a backup plan.

iamRoleArn String

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

planId String

The backup plan ID to be associated with the selection of resources.

conditions List<SelectionConditionArgs>

A list of conditions that you define to assign resources to your backup plans using tags.

name String

The display name of a resource selection document.

notResources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

resources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags List<SelectionSelectionTagArgs>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

iamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

planId string

The backup plan ID to be associated with the selection of resources.

conditions SelectionConditionArgs[]

A list of conditions that you define to assign resources to your backup plans using tags.

name string

The display name of a resource selection document.

notResources string[]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

resources string[]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags SelectionSelectionTagArgs[]

Tag-based conditions used to specify a set of resources to assign to a backup plan.

iam_role_arn str

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

plan_id str

The backup plan ID to be associated with the selection of resources.

conditions Sequence[SelectionConditionArgs]

A list of conditions that you define to assign resources to your backup plans using tags.

name str

The display name of a resource selection document.

not_resources Sequence[str]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

resources Sequence[str]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selection_tags Sequence[SelectionSelectionTagArgs]

Tag-based conditions used to specify a set of resources to assign to a backup plan.

iamRoleArn String

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

planId String

The backup plan ID to be associated with the selection of resources.

conditions List<Property Map>

A list of conditions that you define to assign resources to your backup plans using tags.

name String

The display name of a resource selection document.

notResources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

resources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags List<Property Map>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing Selection Resource

Get an existing Selection 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?: SelectionState, opts?: CustomResourceOptions): Selection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        conditions: Optional[Sequence[SelectionConditionArgs]] = None,
        iam_role_arn: Optional[str] = None,
        name: Optional[str] = None,
        not_resources: Optional[Sequence[str]] = None,
        plan_id: Optional[str] = None,
        resources: Optional[Sequence[str]] = None,
        selection_tags: Optional[Sequence[SelectionSelectionTagArgs]] = None) -> Selection
func GetSelection(ctx *Context, name string, id IDInput, state *SelectionState, opts ...ResourceOption) (*Selection, error)
public static Selection Get(string name, Input<string> id, SelectionState? state, CustomResourceOptions? opts = null)
public static Selection get(String name, Output<String> id, SelectionState 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:
Conditions List<SelectionConditionArgs>

A list of conditions that you define to assign resources to your backup plans using tags.

IamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

Name string

The display name of a resource selection document.

NotResources List<string>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

PlanId string

The backup plan ID to be associated with the selection of resources.

Resources List<string>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

SelectionTags List<SelectionSelectionTagArgs>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

Conditions []SelectionConditionArgs

A list of conditions that you define to assign resources to your backup plans using tags.

IamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

Name string

The display name of a resource selection document.

NotResources []string

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

PlanId string

The backup plan ID to be associated with the selection of resources.

Resources []string

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

SelectionTags []SelectionSelectionTagArgs

Tag-based conditions used to specify a set of resources to assign to a backup plan.

conditions List<SelectionConditionArgs>

A list of conditions that you define to assign resources to your backup plans using tags.

iamRoleArn String

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

name String

The display name of a resource selection document.

notResources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

planId String

The backup plan ID to be associated with the selection of resources.

resources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags List<SelectionSelectionTagArgs>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

conditions SelectionConditionArgs[]

A list of conditions that you define to assign resources to your backup plans using tags.

iamRoleArn string

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

name string

The display name of a resource selection document.

notResources string[]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

planId string

The backup plan ID to be associated with the selection of resources.

resources string[]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags SelectionSelectionTagArgs[]

Tag-based conditions used to specify a set of resources to assign to a backup plan.

conditions Sequence[SelectionConditionArgs]

A list of conditions that you define to assign resources to your backup plans using tags.

iam_role_arn str

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

name str

The display name of a resource selection document.

not_resources Sequence[str]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

plan_id str

The backup plan ID to be associated with the selection of resources.

resources Sequence[str]

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selection_tags Sequence[SelectionSelectionTagArgs]

Tag-based conditions used to specify a set of resources to assign to a backup plan.

conditions List<Property Map>

A list of conditions that you define to assign resources to your backup plans using tags.

iamRoleArn String

The ARN of the IAM role that AWS Backup uses to authenticate when restoring and backing up the target resource. See the AWS Backup Developer Guide for additional information about using AWS managed policies or creating custom policies attached to the IAM role.

name String

The display name of a resource selection document.

notResources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to exclude from a backup plan.

planId String

The backup plan ID to be associated with the selection of resources.

resources List<String>

An array of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan.

selectionTags List<Property Map>

Tag-based conditions used to specify a set of resources to assign to a backup plan.

Supporting Types

SelectionCondition

SelectionConditionStringEqual

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

key string

The key in a key-value pair.

value string

The value in a key-value pair.

key str

The key in a key-value pair.

value str

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

SelectionConditionStringLike

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

key string

The key in a key-value pair.

value string

The value in a key-value pair.

key str

The key in a key-value pair.

value str

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

SelectionConditionStringNotEqual

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

key string

The key in a key-value pair.

value string

The value in a key-value pair.

key str

The key in a key-value pair.

value str

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

SelectionConditionStringNotLike

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

Key string

The key in a key-value pair.

Value string

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

key string

The key in a key-value pair.

value string

The value in a key-value pair.

key str

The key in a key-value pair.

value str

The value in a key-value pair.

key String

The key in a key-value pair.

value String

The value in a key-value pair.

SelectionSelectionTag

Key string

The key in a key-value pair.

Type string

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

Value string

The value in a key-value pair.

Key string

The key in a key-value pair.

Type string

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

Value string

The value in a key-value pair.

key String

The key in a key-value pair.

type String

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

value String

The value in a key-value pair.

key string

The key in a key-value pair.

type string

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

value string

The value in a key-value pair.

key str

The key in a key-value pair.

type str

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

value str

The value in a key-value pair.

key String

The key in a key-value pair.

type String

An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection.

value String

The value in a key-value pair.

Import

Backup selection can be imported using the role plan_id and id separated by |.

 $ pulumi import aws:backup/selection:Selection example plan-id|selection-id

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.