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

PipelineCreateReplaceChangeSetAction does not allow for multiple input artifacts #1247

Closed
seawatts opened this issue Nov 26, 2018 · 11 comments · Fixed by #2020 · May be fixed by MechanicalRock/account-reaper#6
Closed

PipelineCreateReplaceChangeSetAction does not allow for multiple input artifacts #1247

seawatts opened this issue Nov 26, 2018 · 11 comments · Fixed by #2020 · May be fixed by MechanicalRock/account-reaper#6
Assignees
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline feature-request A feature should be added or improved.

Comments

@seawatts
Copy link

From the AWS Pipeline console you can configure a change set action to have multiple input artifacts however, it is not exposed in the CDK. Under the hood it looks like the CDK implements a function called addInputArtifact however, it is a protected function.

@skinny85 skinny85 self-assigned this Nov 26, 2018
@skinny85
Copy link
Contributor

Hey Chris,

thanks for opening the issue. What's the behavior when specifying multiple input artifacts? Is the extra input used to specify parameter overrides? Or something else perhaps?

Thanks,
Adam

@seawatts
Copy link
Author

Hey @skinny85 no problem, thanks for the quick reply.
That is actually exactly what I'm using this for.

Currently I have a mono repo and each sub project I want to be able to deploy to it's own stack so that I can reduce the number of dependencies that are shipped for each project. My pipeline currently looks like source => build => (Update Step)

Update Step has Stack1ChangeSet and Stack2ChangeSet each one get's built with a specific parameter template pointing to each specific build output from the build step.

Does that all make sense?

@skinny85
Copy link
Contributor

That's good, because that use case is actually supported :).

You would do something like this:

new cloudformation. PipelineCreateReplaceChangeSetAction(this, 'Stack1CreateChangeSetAction', {
  stackName: 'YourStack',
  changeSetName: 'YourChangeSet',
  templatePath: buildAction.outputArtifact.atPath('path/to/your/template.yml'),
  templateConfiguration: buildAction.outputArtifact.atPath('path/to/your/overrides/file.json'),
});

And similarly for Stack2ChangeSet.

Let me know if this solves your use case!

@seawatts
Copy link
Author

Yeah that is what I am already doing, however the change set depends on two build artifacts because I have 1 called infrastructure which is where the templatePath / template configuration. But those templates / config point to my other build artifact called website.

@skinny85
Copy link
Contributor

Sorry, I'm not following. Can you show me your code?

@seawatts
Copy link
Author

After talking with @skinny85 offline we have figured out that it is better to expose the PipelineCreateReplaceChangeSetAction to only include one input artifact and instead if we need resources from other build artifacts for cloud formation parameters we can just include those in our buildspec

@seawatts seawatts reopened this Jan 22, 2019
@seawatts
Copy link
Author

Hey, coming back around I ran into another use case where I need this feature.

In actual cloud formation this is possible
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-stages-actions.html#cfn-codepipeline-pipeline-stages-actions-inputartifacts

@eladb eladb added feature-request A feature should be added or improved. gap @aws-cdk/aws-codepipeline Related to AWS CodePipeline labels Feb 4, 2019
@eladb
Copy link
Contributor

eladb commented Feb 4, 2019

@skinny85 are you picking this up?

@skinny85
Copy link
Contributor

skinny85 commented Feb 4, 2019

@seawatts can you explain how are the extra input artifacts used in CloudFormation Actions? What do they do?

@skinny85
Copy link
Contributor

OK, I understand how are the extra input artifacts used in CloudFormation Actions now. I'm working on fixing this.

@skinny85
Copy link
Contributor

PR with the fix: #2020

skinny85 added a commit that referenced this issue Mar 15, 2019
…ctions (#2020)

Additional input Artifacts are needed when using the `parameterOverrides` property of the Action (any Artifact used in that map needs to be added to the input Artifacts of the Action, otherwise the Pipeline will fail at runtime).

Also did some cleanup in the Action superclass while I was in the area.

Fixes #1247
rix0rrr pushed a commit to alex-berger/aws-cdk that referenced this issue Mar 19, 2019
…ctions (aws#2020)

Additional input Artifacts are needed when using the `parameterOverrides` property of the Action (any Artifact used in that map needs to be added to the input Artifacts of the Action, otherwise the Pipeline will fail at runtime).

Also did some cleanup in the Action superclass while I was in the area.

Fixes aws#1247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment