Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-cloudformation): correctly handle the templateConfiguration property in the CreateUpdateStack Pipeline Action #923

Merged
Merged
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
10 changes: 7 additions & 3 deletions packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFo
* IAM role to assume when deploying changes.
*
* If not specified, a fresh role is created. The role is created with zero
* permissions unless `trustTemplate` is true, in which case the role will have
* permissions unless `fullPermissions` is true, in which case the role will have
* full permissions.
*
* @default A fresh role with full or no permissions (depending on the value of `trustTemplate`).
* @default A fresh role with full or no permissions (depending on the value of `fullPermissions`).
*/
role?: iam.Role;

Expand All @@ -123,7 +123,7 @@ export interface PipelineCloudFormationDeployActionProps extends PipelineCloudFo
* stack template contains AWS Identity and Access Management (IAM) resources. For more
* information, see [Acknowledging IAM Resources in AWS CloudFormation Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities).
*
* @default No capabitilities passed, unless `trustTemplate` is true
* @default No capabitilities passed, unless `fullPermissions` is true
*/
capabilities?: CloudFormationCapabilities[];

Expand Down Expand Up @@ -319,7 +319,11 @@ export class PipelineCreateUpdateStackAction extends PipelineCloudFormationDeplo
ActionMode: props.replaceOnFailure ? 'REPLACE_ON_FAILURE' : 'CREATE_UPDATE',
TemplatePath: props.templatePath.location
});

this.addInputArtifact(props.templatePath.artifact);
if (props.templateConfiguration && props.templateConfiguration.artifact.name !== props.templatePath.artifact.name) {
this.addInputArtifact(props.templateConfiguration.artifact);
}

// permissions are based on best-guess from
// https://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-custom-role.html
Expand Down