UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

122 lines 5.71 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RestoreTestingSelection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Backup Restore Testing Selection. * * ## Example Usage * * ### Basic Usage * * ```typescript * 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: ["*"], * }); * ``` * * ### Advanced Usage * * ```typescript * 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, * protectedResourceConditions: { * stringEquals: [{ * key: "aws:ResourceTag/backup", * value: "true", * }], * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Backup Restore Testing Selection using `name:restore_testing_plan_name`. For example: * * ```sh * $ pulumi import aws:backup/restoreTestingSelection:RestoreTestingSelection example restore_testing_selection_12345678:restore_testing_plan_12345678 * ``` */ class RestoreTestingSelection extends pulumi.CustomResource { /** * Get an existing RestoreTestingSelection resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new RestoreTestingSelection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RestoreTestingSelection. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RestoreTestingSelection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["iamRoleArn"] = state ? state.iamRoleArn : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["protectedResourceArns"] = state ? state.protectedResourceArns : undefined; resourceInputs["protectedResourceConditions"] = state ? state.protectedResourceConditions : undefined; resourceInputs["protectedResourceType"] = state ? state.protectedResourceType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["restoreMetadataOverrides"] = state ? state.restoreMetadataOverrides : undefined; resourceInputs["restoreTestingPlanName"] = state ? state.restoreTestingPlanName : undefined; resourceInputs["validationWindowHours"] = state ? state.validationWindowHours : undefined; } else { const args = argsOrState; if ((!args || args.iamRoleArn === undefined) && !opts.urn) { throw new Error("Missing required property 'iamRoleArn'"); } if ((!args || args.protectedResourceType === undefined) && !opts.urn) { throw new Error("Missing required property 'protectedResourceType'"); } if ((!args || args.restoreTestingPlanName === undefined) && !opts.urn) { throw new Error("Missing required property 'restoreTestingPlanName'"); } resourceInputs["iamRoleArn"] = args ? args.iamRoleArn : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["protectedResourceArns"] = args ? args.protectedResourceArns : undefined; resourceInputs["protectedResourceConditions"] = args ? args.protectedResourceConditions : undefined; resourceInputs["protectedResourceType"] = args ? args.protectedResourceType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["restoreMetadataOverrides"] = args ? args.restoreMetadataOverrides : undefined; resourceInputs["restoreTestingPlanName"] = args ? args.restoreTestingPlanName : undefined; resourceInputs["validationWindowHours"] = args ? args.validationWindowHours : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RestoreTestingSelection.__pulumiType, name, resourceInputs, opts); } } exports.RestoreTestingSelection = RestoreTestingSelection; /** @internal */ RestoreTestingSelection.__pulumiType = 'aws:backup/restoreTestingSelection:RestoreTestingSelection'; //# sourceMappingURL=restoreTestingSelection.js.map