Backup / Client / create_restore_testing_selection

create_restore_testing_selection#

Backup.Client.create_restore_testing_selection(**kwargs)#

This request can be sent after CreateRestoreTestingPlan request returns successfully. This is the second part of creating a resource testing plan, and it must be completed sequentially.

This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following:

  • ProtectedResourceArns

  • ProtectedResourceConditions

Each protected resource type can have one single value.

A restore testing selection can include a wildcard value (“*”) for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns.

Cannot select by both protected resource types AND specific ARNs. Request will fail if both are included.

See also: AWS API Documentation

Request Syntax

response = client.create_restore_testing_selection(
    CreatorRequestId='string',
    RestoreTestingPlanName='string',
    RestoreTestingSelection={
        'IamRoleArn': 'string',
        'ProtectedResourceArns': [
            'string',
        ],
        'ProtectedResourceConditions': {
            'StringEquals': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'StringNotEquals': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
        'ProtectedResourceType': 'string',
        'RestoreMetadataOverrides': {
            'string': 'string'
        },
        'RestoreTestingSelectionName': 'string',
        'ValidationWindowHours': 123
    }
)
Parameters:
  • CreatorRequestId (string) – This is an optional unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. If used, this parameter must contain 1 to 50 alphanumeric or ‘-_.’ characters.

  • RestoreTestingPlanName (string) –

    [REQUIRED]

    Input the restore testing plan name that was returned from the related CreateRestoreTestingPlan request.

  • RestoreTestingSelection (dict) –

    [REQUIRED]

    This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following:

    • ProtectedResourceArns

    • ProtectedResourceConditions

    Each protected resource type can have one single value.

    A restore testing selection can include a wildcard value (“*”) for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns.

    • IamRoleArn (string) – [REQUIRED]

      The Amazon Resource Name (ARN) of the IAM role that Backup uses to create the target resource; for example: arn:aws:iam::123456789012:role/S3Access.

    • ProtectedResourceArns (list) –

      Each protected resource can be filtered by its specific ARNs, such as ProtectedResourceArns: ["arn:aws:...", "arn:aws:..."] or by a wildcard: ProtectedResourceArns: ["*"], but not both.

      • (string) –

    • ProtectedResourceConditions (dict) –

      If you have included the wildcard in ProtectedResourceArns, you can include resource conditions, such as ProtectedResourceConditions: { StringEquals: [{ key: "XXXX", value: "YYYY" }].

      • StringEquals (list) –

        Filters the values of your tagged resources for only those resources that you tagged with the same value. Also called “exact matching.”

        • (dict) –

          Pair of two related strings. Allowed characters are letters, white space, and numbers that can be represented in UTF-8 and the following characters: + - = . _ : /

          • Key (string) – [REQUIRED]

            The tag key (String). The key can’t start with aws:.

            Length Constraints: Minimum length of 1. Maximum length of 128.

            Pattern: ^(?![aA]{1}[wW]{1}[sS]{1}:)([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$

          • Value (string) – [REQUIRED]

            The value of the key.

            Length Constraints: Maximum length of 256.

            Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

      • StringNotEquals (list) –

        Filters the values of your tagged resources for only those resources that you tagged that do not have the same value. Also called “negated matching.”

        • (dict) –

          Pair of two related strings. Allowed characters are letters, white space, and numbers that can be represented in UTF-8 and the following characters: + - = . _ : /

          • Key (string) – [REQUIRED]

            The tag key (String). The key can’t start with aws:.

            Length Constraints: Minimum length of 1. Maximum length of 128.

            Pattern: ^(?![aA]{1}[wW]{1}[sS]{1}:)([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$

          • Value (string) – [REQUIRED]

            The value of the key.

            Length Constraints: Maximum length of 256.

            Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

    • ProtectedResourceType (string) – [REQUIRED]

      The type of Amazon Web Services resource included in a restore testing selection; for example, an Amazon EBS volume or an Amazon RDS database.

      Supported resource types accepted include:

      • Aurora for Amazon Aurora

      • DocumentDB for Amazon DocumentDB (with MongoDB compatibility)

      • DynamoDB for Amazon DynamoDB

      • EBS for Amazon Elastic Block Store

      • EC2 for Amazon Elastic Compute Cloud

      • EFS for Amazon Elastic File System

      • FSx for Amazon FSx

      • Neptune for Amazon Neptune

      • RDS for Amazon Relational Database Service

      • S3 for Amazon S3

    • RestoreMetadataOverrides (dict) –

      You can override certain restore metadata keys by including the parameter RestoreMetadataOverrides in the body of RestoreTestingSelection. Key values are not case sensitive.

      See the complete list of restore testing inferred metadata.

      • (string) –

        • (string) –

    • RestoreTestingSelectionName (string) – [REQUIRED]

      This is the unique name of the restore testing selection that belongs to the related restore testing plan.

    • ValidationWindowHours (integer) –

      This is amount of hours (1 to 168) available to run a validation script on the data. The data will be deleted upon the completion of the validation script or the end of the specified retention period, whichever comes first.

Return type:

dict

Returns:

Response Syntax

{
    'CreationTime': datetime(2015, 1, 1),
    'RestoreTestingPlanArn': 'string',
    'RestoreTestingPlanName': 'string',
    'RestoreTestingSelectionName': 'string'
}

Response Structure

  • (dict) –

    • CreationTime (datetime) –

      This is the time the resource testing selection was created successfully.

    • RestoreTestingPlanArn (string) –

      This is the ARN of the restore testing plan with which the restore testing selection is associated.

    • RestoreTestingPlanName (string) –

      Unique string that is the name of the restore testing plan.

      The name cannot be changed after creation. The name consists of only alphanumeric characters and underscores. Maximum length is 50.

    • RestoreTestingSelectionName (string) –

      This is the unique name of the restore testing selection that belongs to the related restore testing plan.

Exceptions

  • Backup.Client.exceptions.AlreadyExistsException

  • Backup.Client.exceptions.InvalidParameterValueException

  • Backup.Client.exceptions.LimitExceededException

  • Backup.Client.exceptions.MissingParameterValueException

  • Backup.Client.exceptions.ResourceNotFoundException

  • Backup.Client.exceptions.ServiceUnavailableException