Skip to content

Commit

Permalink
feat(aws-cloudformation): correctly handle the templateConfiguration …
Browse files Browse the repository at this point in the history
…property in the CreateUpdateStack Pipeline Action. (#923)
  • Loading branch information
skinny85 authored and RomainMuller committed Oct 15, 2018
1 parent 841975a commit d251a46
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit d251a46

Please sign in to comment.