@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
171 lines • 9.1 kB
JavaScript
;
// *** 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, Object.assign(Object.assign({}, 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 ? state.administrationRoleArn : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["autoDeployment"] = state ? state.autoDeployment : undefined;
resourceInputs["callAs"] = state ? state.callAs : undefined;
resourceInputs["capabilities"] = state ? state.capabilities : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["executionRoleName"] = state ? state.executionRoleName : undefined;
resourceInputs["managedExecution"] = state ? state.managedExecution : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["operationPreferences"] = state ? state.operationPreferences : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["permissionModel"] = state ? state.permissionModel : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["stackSetId"] = state ? state.stackSetId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["templateBody"] = state ? state.templateBody : undefined;
resourceInputs["templateUrl"] = state ? state.templateUrl : undefined;
}
else {
const args = argsOrState;
resourceInputs["administrationRoleArn"] = args ? args.administrationRoleArn : undefined;
resourceInputs["autoDeployment"] = args ? args.autoDeployment : undefined;
resourceInputs["callAs"] = args ? args.callAs : undefined;
resourceInputs["capabilities"] = args ? args.capabilities : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["executionRoleName"] = args ? args.executionRoleName : undefined;
resourceInputs["managedExecution"] = args ? args.managedExecution : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["operationPreferences"] = args ? args.operationPreferences : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["permissionModel"] = args ? args.permissionModel : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["templateBody"] = args ? args.templateBody : undefined;
resourceInputs["templateUrl"] = args ? args.templateUrl : undefined;
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