RestoreTestingSelection class

Resource for managing an AWS Backup Restore Testing Selection.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.RestoreTestingSelection("example", {
    name: "ec2_selection",
    restoreTestingPlanName: exampleAwsBackupRestoreTestingPlan.name,
    protectedResourceType: "EC2",
    iamRoleArn: exampleAwsIamRole.arn,
    protectedResourceArns: ["*"],
});
import pulumi
import pulumi_aws as aws

example = aws.backup.RestoreTestingSelection("example",
    name="ec2_selection",
    restore_testing_plan_name=example_aws_backup_restore_testing_plan["name"],
    protected_resource_type="EC2",
    iam_role_arn=example_aws_iam_role["arn"],
    protected_resource_arns=["*"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Backup.RestoreTestingSelection("example", new()
    {
        Name = "ec2_selection",
        RestoreTestingPlanName = exampleAwsBackupRestoreTestingPlan.Name,
        ProtectedResourceType = "EC2",
        IamRoleArn = exampleAwsIamRole.Arn,
        ProtectedResourceArns = new[]
        {
            "*",
        },
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewRestoreTestingSelection(ctx, "example", &backup.RestoreTestingSelectionArgs{
			Name:                   pulumi.String("ec2_selection"),
			RestoreTestingPlanName: pulumi.Any(exampleAwsBackupRestoreTestingPlan.Name),
			ProtectedResourceType:  pulumi.String("EC2"),
			IamRoleArn:             pulumi.Any(exampleAwsIamRole.Arn),
			ProtectedResourceArns: pulumi.StringArray{
				pulumi.String("*"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_backup_restoretestingselection" "example" {
  name                      = "ec2_selection"
  restore_testing_plan_name = exampleAwsBackupRestoreTestingPlan.name
  protected_resource_type   = "EC2"
  iam_role_arn              = exampleAwsIamRole.arn
  protected_resource_arns   = ["*"]
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.backup.RestoreTestingSelection;
import com.pulumi.aws.backup.RestoreTestingSelectionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 RestoreTestingSelection("example", RestoreTestingSelectionArgs.builder()
            .name("ec2_selection")
            .restoreTestingPlanName(exampleAwsBackupRestoreTestingPlan.name())
            .protectedResourceType("EC2")
            .iamRoleArn(exampleAwsIamRole.arn())
            .protectedResourceArns("*")
            .build());

    }
}
resources:
  example:
    type: aws:backup:RestoreTestingSelection
    properties:
      name: ec2_selection
      restoreTestingPlanName: ${exampleAwsBackupRestoreTestingPlan.name}
      protectedResourceType: EC2
      iamRoleArn: ${exampleAwsIamRole.arn}
      protectedResourceArns:
        - '*'

Advanced Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.backup.RestoreTestingSelection("example", {
    protectedResourceConditions: {
        stringEquals: [{
            key: "aws:ResourceTag/backup",
            value: "true",
        }],
    },
    name: "ec2_selection",
    restoreTestingPlanName: exampleAwsBackupRestoreTestingPlan.name,
    protectedResourceType: "EC2",
    iamRoleArn: exampleAwsIamRole.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.backup.RestoreTestingSelection("example",
    protected_resource_conditions={
        "string_equals": [{
            "key": "aws:ResourceTag/backup",
            "value": "true",
        }],
    },
    name="ec2_selection",
    restore_testing_plan_name=example_aws_backup_restore_testing_plan["name"],
    protected_resource_type="EC2",
    iam_role_arn=example_aws_iam_role["arn"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Backup.RestoreTestingSelection("example", new()
    {
        ProtectedResourceConditions = new Aws.Backup.Inputs.RestoreTestingSelectionProtectedResourceConditionsArgs
        {
            StringEquals = new[]
            {
                new Aws.Backup.Inputs.RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs
                {
                    Key = "aws:ResourceTag/backup",
                    Value = "true",
                },
            },
        },
        Name = "ec2_selection",
        RestoreTestingPlanName = exampleAwsBackupRestoreTestingPlan.Name,
        ProtectedResourceType = "EC2",
        IamRoleArn = exampleAwsIamRole.Arn,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := backup.NewRestoreTestingSelection(ctx, "example", &backup.RestoreTestingSelectionArgs{
			ProtectedResourceConditions: &backup.RestoreTestingSelectionProtectedResourceConditionsArgs{
				StringEquals: backup.RestoreTestingSelectionProtectedResourceConditionsStringEqualArray{
					&backup.RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs{
						Key:   pulumi.String("aws:ResourceTag/backup"),
						Value: pulumi.String("true"),
					},
				},
			},
			Name:                   pulumi.String("ec2_selection"),
			RestoreTestingPlanName: pulumi.Any(exampleAwsBackupRestoreTestingPlan.Name),
			ProtectedResourceType:  pulumi.String("EC2"),
			IamRoleArn:             pulumi.Any(exampleAwsIamRole.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_backup_restoretestingselection" "example" {
  protected_resource_conditions = {
    string_equals = [{
      "key"   = "aws:ResourceTag/backup"
      "value" = true
    }]
  }
  name                      = "ec2_selection"
  restore_testing_plan_name = exampleAwsBackupRestoreTestingPlan.name
  protected_resource_type   = "EC2"
  iam_role_arn              = exampleAwsIamRole.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.backup.RestoreTestingSelection;
import com.pulumi.aws.backup.RestoreTestingSelectionArgs;
import com.pulumi.aws.backup.inputs.RestoreTestingSelectionProtectedResourceConditionsArgs;
import com.pulumi.aws.backup.inputs.RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 RestoreTestingSelection("example", RestoreTestingSelectionArgs.builder()
            .protectedResourceConditions(RestoreTestingSelectionProtectedResourceConditionsArgs.builder()
                .stringEquals(RestoreTestingSelectionProtectedResourceConditionsStringEqualArgs.builder()
                    .key("aws:ResourceTag/backup")
                    .value("true")
                    .build())
                .build())
            .name("ec2_selection")
            .restoreTestingPlanName(exampleAwsBackupRestoreTestingPlan.name())
            .protectedResourceType("EC2")
            .iamRoleArn(exampleAwsIamRole.arn())
            .build());

    }
}
resources:
  example:
    type: aws:backup:RestoreTestingSelection
    properties:
      protectedResourceConditions:
        stringEquals:
          - key: aws:ResourceTag/backup
            value: true
      name: ec2_selection
      restoreTestingPlanName: ${exampleAwsBackupRestoreTestingPlan.name}
      protectedResourceType: EC2
      iamRoleArn: ${exampleAwsIamRole.arn}

Import

Using pulumi import, import Backup Restore Testing Selection using name:restore_testing_plan_name. For example:

$ pulumi import aws:backup/restoreTestingSelection:RestoreTestingSelection example restore_testing_selection_12345678:restore_testing_plan_12345678

Constructors

RestoreTestingSelection(String name, {RestoreTestingSelectionArgs? args, CustomResourceOptions? options})
Creates a new RestoreTestingSelection. name The Pulumi resource name. args Arguments used to configure this RestoreTestingSelection. The set of arguments for RestoreTestingSelection. options Resource options controlling this resource's behavior.
RestoreTestingSelection.reference(String urn)
Creates a typed reference to an existing RestoreTestingSelection resource.

Properties

childResources Set<Resource>
finalinherited
completionSources Map<String, IOutputCompletionSource>
latefinalinherited
hashCode int
The hash code for this object.
no setterinherited
iamRoleArn ↔ Output<String>
The ARN of the IAM role.
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
The name of the backup restore testing selection.
latefinal
protectedResourceArns ↔ Output<List<String>>
The ARNs for the protected resources.
latefinal
protectedResourceConditions ↔ Output<RestoreTestingSelectionProtectedResourceConditions?>
The conditions for the protected resource.
latefinal
protectedResourceType ↔ Output<String>
The type of the protected resource.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
restoreMetadataOverrides ↔ Output<Map<String, String>>
Override certain restore metadata keys. See the complete list of restore testing inferred metadata .
latefinal
restoreTestingPlanName ↔ Output<String>
The name of the restore testing plan.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformations List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
validationWindowHours ↔ Output<int>
The amount of hours available to run a validation script on the data. Valid range is 1 to 168.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() String
Returns this resource's logical name.
inherited
getResourceType() String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {RestoreTestingSelectionState? state, CustomResourceOptions? options}) RestoreTestingSelection
Gets an existing RestoreTestingSelection resource's state with the given name and id.