[ aws . backup ]

create-backup-selection

Description

Creates a JSON document that specifies a set of resources to assign to a backup plan. Resources can be included by specifying patterns for a ListOfTags and selected Resources .

For example, consider the following patterns:

  • Resources: "arn:aws:ec2:region:account-id:volume/volume-id"

  • ConditionKey:"department" ConditionValue:"finance" ConditionType:"StringEquals"

  • ConditionKey:"importance" ConditionValue:"critical" ConditionType:"StringEquals"

Using these patterns would back up all Amazon Elastic Block Store (Amazon EBS) volumes that are tagged as "department=finance" , "importance=critical" , in addition to an EBS volume with the specified volume ID.

Resources and conditions are additive in that all resources that match the pattern are selected. This shouldn’t be confused with a logical AND, where all conditions must match. The matching patterns are logically put together using the OR operator. In other words, all patterns that match are selected for backup.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  create-backup-selection
--backup-plan-id <value>
--backup-selection <value>
[--creator-request-id <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--backup-plan-id (string)

Uniquely identifies the backup plan to be associated with the selection of resources.

--backup-selection (structure)

Specifies the body of a request to assign a set of resources to a backup plan.

SelectionName -> (string)

The display name of a resource selection document.

IamRoleArn -> (string)

The ARN of the IAM role that AWS Backup uses to authenticate when backing up the target resource; for example, arn:aws:iam::123456789012:role/S3Access .

Resources -> (list)

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

(string)

ListOfTags -> (list)

An array of conditions used to specify a set of resources to assign to a backup plan; for example, "StringEquals": {"ec2:ResourceTag/Department": "accounting" . Assigns the backup plan to every resource with at least one matching tag.

(structure)

Contains an array of triplets made up of a condition type (such as StringEquals ), a key, and a value. Conditions are used to filter resources in a selection that is assigned to a backup plan.

ConditionType -> (string)

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

ConditionKey -> (string)

The key in a key-value pair. For example, in "ec2:ResourceTag/Department": "accounting" , "ec2:ResourceTag/Department" is the key.

ConditionValue -> (string)

The value in a key-value pair. For example, in "ec2:ResourceTag/Department": "accounting" , "accounting" is the value.

Shorthand Syntax:

SelectionName=string,IamRoleArn=string,Resources=string,string,ListOfTags=[{ConditionType=string,ConditionKey=string,ConditionValue=string},{ConditionType=string,ConditionKey=string,ConditionValue=string}]

JSON Syntax:

{
  "SelectionName": "string",
  "IamRoleArn": "string",
  "Resources": ["string", ...],
  "ListOfTags": [
    {
      "ConditionType": "STRINGEQUALS",
      "ConditionKey": "string",
      "ConditionValue": "string"
    }
    ...
  ]
}

--creator-request-id (string)

A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Output

SelectionId -> (string)

Uniquely identifies the body of a request to assign a set of resources to a backup plan.

BackupPlanId -> (string)

Uniquely identifies a backup plan.

CreationDate -> (timestamp)

The date and time a backup selection is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.