Edit the JSON file to add a new action in the Deploy stage. For ActionMode, enter CHANGE_SET_EXECUTE:
{ "name": "Deploy",
"blockers": null,
"actions": [
{
"name": "Deploy",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"provider": "CloudFormation",
"version": "1"
},
"runOrder": 1,
"configuration": {
"TemplatePath": "SourceArtifact::ssm.yml",
"ActionMode": "CHANGE_SET_REPLACE",
"Capabilities": "CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND",
"ChangeSetName": "CFNTest-CS",
"RoleArn": "arn:aws:iam::xxxxx:role/xxx",
"StackName": "CFNTest"
},
"outputArtifacts": [],
"inputArtifacts": [
{
"name": "SourceArtifact"
}
],
"roleArn": null,
"region": "us-east-1",
"namespace": "DeployVariables"
},
{
"name": "ExecuteChangeSet",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"provider": "CloudFormation",
"version": "1"
},
"runOrder": 2,
"configuration": {
"ActionMode": "CHANGE_SET_EXECUTE",
"ChangeSetName": "CFNTest-CS",
"StackName": "CFNTest"
},
"outputArtifacts": [],
"inputArtifacts": [
{
"name": "SourceArtifact"
}
],
"roleArn": null,
"region": "us-east-1",
"namespace": null
}
]
}
To apply your changes, run the following update-pipeline command:
aws codepipeline update-pipeline --cli-input-json file://pipeline.json
The update-pipeline command stops the pipeline, including any running revisions. The next time you change the source location, the pipeline automatically runs that revision through the revised pipeline structure. To manually run the last revision through the revised structure of the pipeline, run the start-pipeline-execution command:
aws codepipeline start-pipeline-execution --name MyPipeline
Note: Replace MyPipeline with your pipeline name.