interface CloudFormationExecuteChangeSetActionProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Actions.CloudFormationExecuteChangeSetActionProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#CloudFormationExecuteChangeSetActionProps |
![]() | software.amazon.awscdk.services.codepipeline.actions.CloudFormationExecuteChangeSetActionProps |
![]() | aws_cdk.aws_codepipeline_actions.CloudFormationExecuteChangeSetActionProps |
![]() | aws-cdk-lib » aws_codepipeline_actions » CloudFormationExecuteChangeSetActionProps |
Properties for the CloudFormationExecuteChangeSetAction.
Example
// Source stage: read from repository
const repo = new codecommit.Repository(stack, 'TemplateRepo', {
repositoryName: 'template-repo',
});
const sourceOutput = new codepipeline.Artifact('SourceArtifact');
const source = new cpactions.CodeCommitSourceAction({
actionName: 'Source',
repository: repo,
output: sourceOutput,
trigger: cpactions.CodeCommitTrigger.POLL,
});
const sourceStage = {
stageName: 'Source',
actions: [source],
};
// Deployment stage: create and deploy changeset with manual approval
const stackName = 'OurStack';
const changeSetName = 'StagedChangeSet';
const prodStage = {
stageName: 'Deploy',
actions: [
new cpactions.CloudFormationCreateReplaceChangeSetAction({
actionName: 'PrepareChanges',
stackName,
changeSetName,
adminPermissions: true,
templatePath: sourceOutput.atPath('template.yaml'),
runOrder: 1,
}),
new cpactions.ManualApprovalAction({
actionName: 'ApproveChanges',
runOrder: 2,
}),
new cpactions.CloudFormationExecuteChangeSetAction({
actionName: 'ExecuteChanges',
stackName,
changeSetName,
runOrder: 3,
}),
],
};
new codepipeline.Pipeline(stack, 'Pipeline', {
crossAccountKeys: true,
stages: [
sourceStage,
prodStage,
],
});
Properties
Name | Type | Description |
---|---|---|
action | string | The physical, human-readable name of the Action. |
change | string | Name of the change set to execute. |
stack | string | The name of the stack to apply this action to. |
account? | string | The AWS account this Action is supposed to operate in. |
output? | Artifact | The name of the output artifact to generate. |
output | string | A name for the filename in the output artifact to store the AWS CloudFormation call's result. |
region? | string | The AWS region the given Action resides in. |
role? | IRole | The Role in which context's this Action will be executing in. |
run | number | The runOrder property for this Action. |
variables | string | The name of the namespace to use for variables emitted by this action. |
actionName
Type:
string
The physical, human-readable name of the Action.
Note that Action names must be unique within a single Stage.
changeSetName
Type:
string
Name of the change set to execute.
stackName
Type:
string
The name of the stack to apply this action to.
account?
Type:
string
(optional, default: action resides in the same account as the pipeline)
The AWS account this Action is supposed to operate in.
Note: if you specify the role
property,
this is ignored - the action will operate in the same region the passed role does.
output?
Type:
Artifact
(optional, default: Automatically generated artifact name.)
The name of the output artifact to generate.
Only applied if outputFileName
is set as well.
outputFileName?
Type:
string
(optional, default: No output artifact generated)
A name for the filename in the output artifact to store the AWS CloudFormation call's result.
The file will contain the result of the call to AWS CloudFormation (for example the call to UpdateStack or CreateChangeSet).
AWS CodePipeline adds the file to the output artifact after performing the specified action.
region?
Type:
string
(optional, default: the Action resides in the same region as the Pipeline)
The AWS region the given Action resides in.
Note that a cross-region Pipeline requires replication buckets to function correctly.
You can provide their names with the PipelineProps#crossRegionReplicationBuckets
property.
If you don't, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,
that you will need to cdk deploy
before deploying the main, Pipeline-containing Stack.
role?
Type:
IRole
(optional, default: a new Role will be generated)
The Role in which context's this Action will be executing in.
The Pipeline's Role will assume this Role
(the required permissions for that will be granted automatically)
right before executing this Action.
This Action will be passed into your IAction.bind
method in the ActionBindOptions.role
property.
runOrder?
Type:
number
(optional, default: 1)
The runOrder property for this Action.
RunOrder determines the relative order in which multiple Actions in the same Stage execute.
See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
variablesNamespace?
Type:
string
(optional, default: a name will be generated, based on the stage and action names,
if any of the action's variables were referenced - otherwise,
no namespace will be set)
The name of the namespace to use for variables emitted by this action.