From f0e7bb5085967059e004120325138cd01bd4dea2 Mon Sep 17 00:00:00 2001 From: Breland Miley Date: Wed, 15 Aug 2018 00:15:21 -0700 Subject: [PATCH] Add a resolve to ArtifactPath (#571) * 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 * Resolve location at l2 time --- packages/@aws-cdk/aws-cloudformation/lib/pipeline-actions.ts | 2 +- .../test/test.cloudformation-pipeline-actions.ts | 4 +++- 2 files changed, 4 insertions(+), 2 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/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",