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

Can't use a ArtifactPath for template configuration in CloudFormation + CodePipeline #570

Closed
mindstorms6 opened this issue Aug 15, 2018 · 1 comment · Fixed by #571
Closed

Comments

@mindstorms6
Copy link
Contributor

mindstorms6 commented Aug 15, 2018

Hi friends!

I have a cdk CFN action that tries to do:

    new CreateReplaceChangeSet(stack, 'BuildChangeSetProd', {
      stage: prodStage,
      stackName,
      changeSetName,
      role: changeSetExecRole,
      templatePath: new ArtifactPath(buildAction.artifact!, 'template.yaml'),
      templateConfiguration: new ArtifactPath(buildAction.artifact!, 'templateConfig.json')
    });

When running this however during synth - the CDK gets very upset with me saying

test.cloudformation-pipeline-actions.js
✖ CreateChangeSetAction can be used to make a change set from a CodePipeline                                                                                                                                                                                                                  While synthesizing MagicPipeline/Resource: Trying to resolve() a Construct at /stages/2/actions/0/configuration/TemplateConfiguration/artifact
    --- resource created at ---                           
at new Pipeline (/Users/brelandm/repos/aws-cdk/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts:22:4)
at Object.CreateChangeSetAction can be used to make a change set from a CodePipeline (/Users/brelandm/repos/aws-cdk/packages/@aws-cdk/aws-codepipeline/test/test.cloudformation-pipeline-actions.ts:18:22)
at Object.<anonymous> (/Users/brelandm/repos/aws-cdk/node_modules/nodeunit/lib/core.js:236:16) 
at /Users/brelandm/repos/aws-cdk/node_modules/nodeunit/lib/core.js:236:16

Which, I'm not sure what that means TBH.
Oddly, removing the last line fixes it though :

templateConfiguration: new ArtifactPath(buildAction.artifact!, 'templateConfig.json')

Even though the line above it is effectively the same.

I'm adding a test now - any thoughts on what this message is telling me and how to deal with it?

@mindstorms6
Copy link
Contributor Author

JK!
Wrote a test and a fix is incoming.

mindstorms6 added a commit to mindstorms6/aws-cdk-1 that referenced this issue Aug 15, 2018
When using artifact path for template configuration, the CDK would get upset.
This just adds a resolve that falls back to that location.

Fixes aws#570
mindstorms6 added a commit that referenced this issue Aug 15, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant