UNPKG

@pulumi/aws

Version:

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

171 lines 8.46 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.StackSet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a CloudFormation StackSet. StackSets allow CloudFormation templates to be easily deployed across multiple accounts and regions via StackSet Instances (`aws.cloudformation.StackSetInstance` resource). Additional information about StackSets can be found in the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html). * * > **NOTE:** All template parameters, including those with a `Default`, must be configured or ignored with the `lifecycle` configuration block `ignoreChanges` argument. * * > **NOTE:** All `NoEcho` template parameters must be ignored with the `lifecycle` configuration block `ignoreChanges` argument. * * > **NOTE:** When using a delegated administrator account, ensure that your IAM User or Role has the `organizations:ListDelegatedAdministrators` permission. Otherwise, you may get an error like `ValidationError: Account used is not a delegated administrator`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy = aws.iam.getPolicyDocument({ * statements: [{ * actions: ["sts:AssumeRole"], * effect: "Allow", * principals: [{ * identifiers: ["cloudformation.amazonaws.com"], * type: "Service", * }], * }], * }); * const aWSCloudFormationStackSetAdministrationRole = new aws.iam.Role("AWSCloudFormationStackSetAdministrationRole", { * assumeRolePolicy: aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy.then(aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy => aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy.json), * name: "AWSCloudFormationStackSetAdministrationRole", * }); * const example = new aws.cloudformation.StackSet("example", { * administrationRoleArn: aWSCloudFormationStackSetAdministrationRole.arn, * name: "example", * parameters: { * VPCCidr: "10.0.0.0/16", * }, * templateBody: JSON.stringify({ * Parameters: { * VPCCidr: { * Type: "String", * Default: "10.0.0.0/16", * Description: "Enter the CIDR block for the VPC. Default is 10.0.0.0/16.", * }, * }, * Resources: { * myVpc: { * Type: "AWS::EC2::VPC", * Properties: { * CidrBlock: { * Ref: "VPCCidr", * }, * Tags: [{ * Key: "Name", * Value: "Primary_CF_VPC", * }], * }, * }, * }, * }), * }); * const aWSCloudFormationStackSetAdministrationRoleExecutionPolicy = aws.iam.getPolicyDocumentOutput({ * statements: [{ * actions: ["sts:AssumeRole"], * effect: "Allow", * resources: [pulumi.interpolate`arn:aws:iam::*:role/${example.executionRoleName}`], * }], * }); * const aWSCloudFormationStackSetAdministrationRoleExecutionPolicyRolePolicy = new aws.iam.RolePolicy("AWSCloudFormationStackSetAdministrationRole_ExecutionPolicy", { * name: "ExecutionPolicy", * policy: aWSCloudFormationStackSetAdministrationRoleExecutionPolicy.apply(aWSCloudFormationStackSetAdministrationRoleExecutionPolicy => aWSCloudFormationStackSetAdministrationRoleExecutionPolicy.json), * role: aWSCloudFormationStackSetAdministrationRole.name, * }); * ``` * * ## Import * * Import CloudFormation StackSets when acting a delegated administrator in a member account using the `name` and `call_as` values separated by a comma (`,`). For example: * * Using `pulumi import`, import CloudFormation StackSets using the `name`. For example: * * ```sh * $ pulumi import aws:cloudformation/stackSet:StackSet example example * ``` * Using `pulumi import`, import CloudFormation StackSets when acting a delegated administrator in a member account using the `name` and `call_as` values separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:cloudformation/stackSet:StackSet example example,DELEGATED_ADMIN * ``` */ class StackSet extends pulumi.CustomResource { /** * Get an existing StackSet 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 StackSet(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of StackSet. 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'] === StackSet.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["administrationRoleArn"] = state?.administrationRoleArn; resourceInputs["arn"] = state?.arn; resourceInputs["autoDeployment"] = state?.autoDeployment; resourceInputs["callAs"] = state?.callAs; resourceInputs["capabilities"] = state?.capabilities; resourceInputs["description"] = state?.description; resourceInputs["executionRoleName"] = state?.executionRoleName; resourceInputs["managedExecution"] = state?.managedExecution; resourceInputs["name"] = state?.name; resourceInputs["operationPreferences"] = state?.operationPreferences; resourceInputs["parameters"] = state?.parameters; resourceInputs["permissionModel"] = state?.permissionModel; resourceInputs["region"] = state?.region; resourceInputs["stackSetId"] = state?.stackSetId; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["templateBody"] = state?.templateBody; resourceInputs["templateUrl"] = state?.templateUrl; } else { const args = argsOrState; resourceInputs["administrationRoleArn"] = args?.administrationRoleArn; resourceInputs["autoDeployment"] = args?.autoDeployment; resourceInputs["callAs"] = args?.callAs; resourceInputs["capabilities"] = args?.capabilities; resourceInputs["description"] = args?.description; resourceInputs["executionRoleName"] = args?.executionRoleName; resourceInputs["managedExecution"] = args?.managedExecution; resourceInputs["name"] = args?.name; resourceInputs["operationPreferences"] = args?.operationPreferences; resourceInputs["parameters"] = args?.parameters; resourceInputs["permissionModel"] = args?.permissionModel; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["templateBody"] = args?.templateBody; resourceInputs["templateUrl"] = args?.templateUrl; resourceInputs["arn"] = undefined /*out*/; resourceInputs["stackSetId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StackSet.__pulumiType, name, resourceInputs, opts); } } exports.StackSet = StackSet; /** @internal */ StackSet.__pulumiType = 'aws:cloudformation/stackSet:StackSet'; //# sourceMappingURL=stackSet.js.map