class CloudFormationDeployStackInstancesAction
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Actions.CloudFormationDeployStackInstancesAction |
![]() | software.amazon.awscdk.services.codepipeline.actions.CloudFormationDeployStackInstancesAction |
![]() | aws_cdk.aws_codepipeline_actions.CloudFormationDeployStackInstancesAction |
![]() | @aws-cdk/aws-codepipeline-actions » CloudFormationDeployStackInstancesAction |
Implements
IAction
Extends
Action
CodePipeline action to create/update Stack Instances of a StackSet.
After the initial creation of a stack set, you can add new stack instances by using CloudFormationStackInstances. Template parameter values can be overridden at the stack instance level during create or update stack set instance operations.
Each stack set has one template and set of template parameters. When you update the template or template parameters, you update them for the entire set. Then all instance statuses are set to OUTDATED until the changes are deployed to that instance.
Example
declare const pipeline: codepipeline.Pipeline;
declare const sourceOutput: codepipeline.Artifact;
pipeline.addStage({
stageName: 'DeployStackSets',
actions: [
// First, update the StackSet itself with the newest template
new codepipeline_actions.CloudFormationDeployStackSetAction({
actionName: 'UpdateStackSet',
runOrder: 1,
stackSetName: 'MyStackSet',
template: codepipeline_actions.StackSetTemplate.fromArtifactPath(sourceOutput.atPath('template.yaml')),
// Change this to 'StackSetDeploymentModel.organizations()' if you want to deploy to OUs
deploymentModel: codepipeline_actions.StackSetDeploymentModel.selfManaged(),
// This deploys to a set of accounts
stackInstances: codepipeline_actions.StackInstances.inAccounts(['111111111111'], ['us-east-1', 'eu-west-1']),
}),
// Afterwards, update/create additional instances in other accounts
new codepipeline_actions.CloudFormationDeployStackInstancesAction({
actionName: 'AddMoreInstances',
runOrder: 2,
stackSetName: 'MyStackSet',
stackInstances: codepipeline_actions.StackInstances.inAccounts(
['222222222222', '333333333333'],
['us-east-1', 'eu-west-1']
),
}),
],
});
Initializer
new CloudFormationDeployStackInstancesAction(props: CloudFormationDeployStackInstancesActionProps)
Parameters
Properties
Name | Type | Description |
---|---|---|
action | Action | The simple properties of the Action, like its Owner, name, etc. |
actionProperties
Type:
Action
The simple properties of the Action, like its Owner, name, etc.
Note that this accessor will be called before the {@link bind} callback.
Methods
Name | Description |
---|---|
bind(scope, stage, options) | The callback invoked when this Action is added to a Pipeline. |
on | Creates an Event that will be triggered whenever the state of this Action changes. |
protected bound(scope, _stage, options) | This is a renamed version of the {@link IAction.bind} method. |
bind(scope, stage, options)
public bind(scope: Construct, stage: IStage, options: ActionBindOptions): ActionConfig
Parameters
- scope
Construct
- stage
IStage
- options
Action
Bind Options
Returns
The callback invoked when this Action is added to a Pipeline.
onStateChange(name, target?, options?)
public onStateChange(name: string, target?: IRuleTarget, options?: RuleProps): Rule
Parameters
- name
string
- target
IRule
Target - options
Rule
Props
Returns
Creates an Event that will be triggered whenever the state of this Action changes.
protected bound(scope, _stage, options)
protected bound(scope: Construct, _stage: IStage, options: ActionBindOptions): ActionConfig
Parameters
- scope
Construct
- _stage
IStage
- options
Action
Bind Options
Returns
This is a renamed version of the {@link IAction.bind} method.