From b9321c66a61e71569bfe60ff58bb8780ac1e16ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=92=85=20=F0=9F=92=83=20=F0=9F=8C=88=20Miley?= Date: Tue, 14 Aug 2018 17:26:37 -0700 Subject: [PATCH 1/2] Add a resolve to ArtifactPath When using artifact path for template configuration, the CDK would get upset. This just adds a resolve that falls back to that location. Fixes #570 --- packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts | 4 ++++ .../test/test.cloudformation-pipeline-actions.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts b/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts index 6663e5375effa..ef82ae3c93f2e 100644 --- a/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts +++ b/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts @@ -87,4 +87,8 @@ export class ArtifactPath { get location() { return `${this.artifact.name}::${this.fileName}`; } + + public resolve() { + return this.location; + } } diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts index 3ce276d0f9542..31af69b00e18b 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts @@ -63,6 +63,7 @@ export = { changeSetName, role: changeSetExecRole, templatePath: new ArtifactPath(buildAction.artifact!, 'template.yaml'), + templateConfiguration: new ArtifactPath(buildAction.artifact!, 'templateConfig.json') }); new ExecuteChangeSet(stack, 'ExecuteChangeSetProd', { @@ -160,7 +161,8 @@ export = { ] }, "StackName": "BrelandsStack", - "TemplatePath": "OutputYo::template.yaml" + "TemplatePath": "OutputYo::template.yaml", + "TemplateConfiguration": "OutputYo::templateConfig.json" }, "InputArtifacts": [{"Name": "OutputYo"}], "Name": "BuildChangeSetProd", From b7dc4d85796d44efbf65a4e968ff1e11b0420c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=92=85=20=F0=9F=92=83=20=F0=9F=8C=88=20Miley?= Date: Tue, 14 Aug 2018 23:55:38 -0700 Subject: [PATCH 2/2] Resolve location at l2 time --- packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts | 2 +- packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts b/packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts index 0538704f2e422..ccf019dfaba0e 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts @@ -188,7 +188,7 @@ export abstract class CloudFormationDeploymentAction extends CloudFormationActio Capabilities: (capabilities && capabilities.join(',')) || undefined, RoleArn: new cdk.Token(() => this.role.roleArn), ParameterOverrides: props.parameterOverrides, - TemplateConfiguration: props.templateConfiguration, + TemplateConfiguration: props.templateConfiguration ? props.templateConfiguration.location : undefined, StackName: props.stackName, }); diff --git a/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts b/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts index ef82ae3c93f2e..6663e5375effa 100644 --- a/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts +++ b/packages/@aws-cdk/aws-codepipeline-api/lib/artifact.ts @@ -87,8 +87,4 @@ export class ArtifactPath { get location() { return `${this.artifact.name}::${this.fileName}`; } - - public resolve() { - return this.location; - } }