"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFormationDeployStackSetAction=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),codepipeline=require("../../../aws-codepipeline"),action_1=require("../action"),common_1=require("../common"),singleton_policy_1=require("./private/singleton-policy"),stackset_types_1=require("./stackset-types");class CloudFormationDeployStackSetAction extends action_1.Action{constructor(props){var _b,_c,_d,_e,_f,_g;super({...props,region:props.stackSetRegion,provider:"CloudFormationStackSet",category:codepipeline.ActionCategory.DEPLOY,artifactBounds:{minInputs:1,maxInputs:3,minOutputs:0,maxOutputs:0},inputs:[...(_b=props.template._artifactsReferenced)!==null&&_b!==void 0?_b:[],...(_d=(_c=props.parameters)===null||_c===void 0?void 0:_c._artifactsReferenced)!==null&&_d!==void 0?_d:[],...(_f=(_e=props.stackInstances)===null||_e===void 0?void 0:_e._artifactsReferenced)!==null&&_f!==void 0?_f:[]]});jsiiDeprecationWarnings.aws_cdk_lib_aws_codepipeline_actions_CloudFormationDeployStackSetActionProps(props),this.props=props,this.deploymentModel=(_g=props.deploymentModel)!==null&&_g!==void 0?_g:stackset_types_1.StackSetDeploymentModel.selfManaged(),common_1.validatePercentage("failureTolerancePercentage",props.failureTolerancePercentage),common_1.validatePercentage("maxAccountConcurrencyPercentage",props.maxAccountConcurrencyPercentage)}bound(scope,_stage,options){var _b,_c,_d,_e;jsiiDeprecationWarnings.aws_cdk_lib_aws_codepipeline_IStage(_stage),jsiiDeprecationWarnings.aws_cdk_lib_aws_codepipeline_ActionBindOptions(options);const singletonPolicy=singleton_policy_1.SingletonPolicy.forRole(options.role);singletonPolicy.grantCreateUpdateStackSet(this.props);const instancesResult=(_b=this.props.stackInstances)===null||_b===void 0?void 0:_b._bind(scope),permissionModelBind=(_c=this.deploymentModel)===null||_c===void 0?void 0:_c._bind(scope);for(const role of(_d=permissionModelBind==null?void 0:permissionModelBind.passedRoles)!==null&&_d!==void 0?_d:[])singletonPolicy.grantPassRole(role);return(this.actionProperties.inputs||[]).length>0&&options.bucket.grantRead(singletonPolicy),{configuration:{StackSetName:this.props.stackSetName,Description:this.props.description,TemplatePath:this.props.template._render(),Parameters:(_e=this.props.parameters)===null||_e===void 0?void 0:_e._render(),Capabilities:singleton_policy_1.parseCapabilities(this.props.cfnCapabilities),FailureTolerancePercentage:this.props.failureTolerancePercentage,MaxConcurrentPercentage:this.props.maxAccountConcurrencyPercentage,...instancesResult==null?void 0:instancesResult.stackSetConfiguration,...permissionModelBind==null?void 0:permissionModelBind.stackSetConfiguration}}}}exports.CloudFormationDeployStackSetAction=CloudFormationDeployStackSetAction,_a=JSII_RTTI_SYMBOL_1,CloudFormationDeployStackSetAction[_a]={fqn:"aws-cdk-lib.aws_codepipeline_actions.CloudFormationDeployStackSetAction",version:"2.13.0"};
//# sourceMappingURL=stackset-action.js.map
