interface CloudFormationCreateReplaceChangeSetActionProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Actions.CloudFormationCreateReplaceChangeSetActionProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#CloudFormationCreateReplaceChangeSetActionProps |
![]() | software.amazon.awscdk.services.codepipeline.actions.CloudFormationCreateReplaceChangeSetActionProps |
![]() | aws_cdk.aws_codepipeline_actions.CloudFormationCreateReplaceChangeSetActionProps |
![]() | aws-cdk-lib » aws_codepipeline_actions » CloudFormationCreateReplaceChangeSetActionProps |
Properties for the CloudFormationCreateReplaceChangeSetAction.
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. |
admin | boolean | Whether to grant full permissions to CloudFormation while deploying this template. |
change | string | Name of the change set to create or update. |
stack | string | The name of the stack to apply this action to. |
template | Artifact | Input artifact with the ChangeSet's CloudFormation template. |
account? | string | The AWS account this Action is supposed to operate in. |
cfn | Cfn [] | Acknowledge certain changes made as part of deployment. |
deployment | IRole | IAM role to assume when deploying changes. |
extra | Artifact [] | The list of additional input Artifacts for this Action. |
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. |
parameter | { [string]: any } | Additional template parameters. |
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. |
template | Artifact | Input artifact to use for template parameters values and stack policy. |
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.
adminPermissions
Type:
boolean
Whether to grant full permissions to CloudFormation while deploying this template.
Setting this to true
affects the defaults for role
and capabilities
, if you
don't specify any alternatives.
The default role that will be created for you will have full (i.e., *
)
permissions on all resources, and the deployment will have named IAM
capabilities (i.e., able to create all IAM resources).
This is a shorthand that you can use if you fully trust the templates that
are deployed in this pipeline. If you want more fine-grained permissions,
use addToRolePolicy
and capabilities
to control what the CloudFormation
deployment is allowed to do.
changeSetName
Type:
string
Name of the change set to create or update.
stackName
Type:
string
The name of the stack to apply this action to.
templatePath
Type:
Artifact
Input artifact with the ChangeSet's CloudFormation template.
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.
cfnCapabilities?
Type:
Cfn
[]
(optional, default: None, unless adminPermissions
is true)
Acknowledge certain changes made as part of deployment.
For stacks that contain certain resources,
explicit acknowledgement is required that AWS CloudFormation might create or update those resources.
For example, you must specify ANONYMOUS_IAM
or NAMED_IAM
if your stack template contains AWS
Identity and Access Management (IAM) resources.
For more information, see the link below.
deploymentRole?
Type:
IRole
(optional, default: A fresh role with full or no permissions (depending on the value of adminPermissions
).)
IAM role to assume when deploying changes.
If not specified, a fresh role is created. The role is created with zero
permissions unless adminPermissions
is true, in which case the role will have
full permissions.
extraInputs?
Type:
Artifact
[]
(optional)
The list of additional input Artifacts for this Action.
This is especially useful when used in conjunction with the parameterOverrides
property.
For example, if you have:
parameterOverrides: { 'Param1': action1.outputArtifact.bucketName, 'Param2': action2.outputArtifact.objectKey, }
, if the output Artifacts of action1
and action2
were not used to
set either the templateConfiguration
or the templatePath
properties,
you need to make sure to include them in the extraInputs
-
otherwise, you'll get an "unrecognized Artifact" error during your Pipeline's execution.
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.
parameterOverrides?
Type:
{ [string]: any }
(optional, default: No overrides)
Additional template parameters.
Template parameters specified here take precedence over template parameters
found in the artifact specified by the templateConfiguration
property.
We recommend that you use the template configuration file to specify most of your parameter values. Use parameter overrides to specify only dynamic parameter values (values that are unknown until you run the pipeline).
All parameter names must be present in the stack template.
Note: the entire object cannot be more than 1kB.
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.
templateConfiguration?
Type:
Artifact
(optional, default: No template configuration based on input artifacts)
Input artifact to use for template parameters values and stack policy.
The template configuration file should contain a JSON object that should look like this:
{ "Parameters": {...}, "Tags": {...}, "StackPolicy": {... }}
. For more information,
see AWS CloudFormation Artifacts.
Note that if you include sensitive information, such as passwords, restrict access to this file.
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.