Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export abstract class CloudFormationDeploymentAction extends CloudFormationActio
// This must be a string, so flatten the list to a comma-separated string.
Capabilities: (capabilities && capabilities.join(',')) || undefined,
RoleArn: new cdk.Token(() => this.role.roleArn),
ParameterOverrides: props.parameterOverrides,
ParameterOverrides: cdk.CloudFormationJSON.stringify(props.parameterOverrides),
TemplateConfiguration: props.templateConfiguration ? props.templateConfiguration.location : undefined,
StackName: props.stackName,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,45 @@ export = {

test.done();
},

'parameterOverrides are serialized as a string'(test: Test) {
// GIVEN
const stack = new TestFixture();

// WHEN
new CreateUpdateStack(stack, 'CreateUpdate', {
stage: stack.deployStage,
stackName: 'MyStack',
templatePath: stack.source.artifact.subartifact('template.yaml'),
parameterOverrides: {
RepoName: stack.repo.repositoryName
}
});

// THEN
expect(stack).to(haveResource('AWS::CodePipeline::Pipeline', {
"Stages": [
{ "Name": "Source" /* don't care about the rest */ },
{
"Name": "Deploy",
"Actions": [
{
"Configuration": {
"ParameterOverrides": { "Fn::Join": [ "", [
"{\"RepoName\":\"",
{ "Fn::GetAtt": [ "MyVeryImportantRepo11BC3EBD", "Name" ] },
"\"}"
]]}
},
"Name": "CreateUpdate",
},
],
}
]
}));

test.done();
}
};

/**
Expand Down