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

Issue where multiple --parameter-overrides are not received by AWS CLI when called from porter #11

Closed
TheeJamesLee opened this issue Nov 28, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@TheeJamesLee
Copy link

TheeJamesLee commented Nov 28, 2019

Hi, I believe this to be some interaction between porter and the porter-aws mixin.

Problem:
Porter calling the "aws cloudformation deploy" command with the flag --parameter-overrides Key1=Value1 Key2=Value2 --someOtherFlag, appears to only pass in the first Key1=Value1 .

However, if I launch a container of the porter image, I can manually run the cloudformation command copied and pasted and it will run fine.

Here is the output of the error from Porter's debug output of the step. If I swap the 2 parameters around, it will toggle the error of which key is missing and only take the first.

Upsert stack
DEBUG mixin:    aws
DEBUG mixinDir: /cnab/app/mixins/aws
DEBUG file:
DEBUG stdin:
install:
- aws:
    description: Upsert stack
    flags:
      no-fail-on-empty-changeset: null
      parameter-overrides: Key1=Value1 Key2=Value2
      region: eu-west-1
      stack-name: stack-x
      template-file: CFtemplates/Template.template
    operation: deploy
    service: cloudformation

/cnab/app/mixins/aws/aws-runtime install --debug
/usr/local/bin/aws aws cloudformation deploy --no-fail-on-empty-changeset --output json --parameter-overrides Key1=Value1 Key2=Value2 --region eu-west-1 --stack-x --template-file CFtemplates/Template.template
DEBUG Parsed Input:
&aws.Action{Steps:[]aws.Steps{aws.Steps{Step:aws.Step{Description:"Upsert stack", Service:"cloudformation", Operation:"deploy", Arguments:[]string(nil), Flags:builder.Flags{builder.Flag{Name:"no-fail-on-empty-changeset", Values:[]string(nil)}, builder.Flag{Name:"parameter-overrides", Values:[]string{"Key1=Value1 Key2=Value2"}}, builder.Flag{Name:"region", Values:[]string{"eu-west-1"}}, builder.Flag{Name:"stack-name", Values:[]string{"stack-x"}}, builder.Flag{Name:"template-file", Values:[]string{"CFtemplates/Template.template"}}}, Outputs:[]aws.Output(nil)}}}}

An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameters: [Key2] must have values
err: error running command /usr/local/bin/aws aws cloudformation deploy --no-fail-on-empty-changeset --output json --parameter-overrides Key1=Value1 Key2=Value2 --region eu-west-1 --stack-name stack-x --template-file CFtemplates/Template.template: exit status 255
Error: error running command /usr/local/bin/aws aws cloudformation deploy --no-fail-on-empty-changeset --output json --parameter-overrides Key1=Value1 Key2=Value2 --region eu-west-1 --stack-name stack-x --template-file CFtemplates/Template.template: exit status 255
Error: mixin execution failed: exit status 1
Resolved instance-store plugin to instance-store.porter.filesystem
C:\Users\x\.porter\porter plugin run instance-store.porter.filesystem
Error: 1 error occurred:
        * failed to install the bundle: container exit code: 1, message: <nil>
@TheeJamesLee
Copy link
Author

Fyi, my current workaround is to just us the exec mixin calling bash for now - the commands succeed there and so 99% sure it's going to be the porter-aws mixin

@carolynvs carolynvs added the bug Something isn't working label Dec 2, 2019
@carolynvs
Copy link
Member

Can you share what the yaml looks like for the exec mixin workaround? They actually share the same code (aws/exec) so that will help me figure out where the bug may be.

@TheeJamesLee
Copy link
Author

Here is the above command working, but via commanding bash using the exec mixin.

install:
  - exec:
      description: "Update Cloud Formation Stack via bash"
      command: bash
      flags:
        c: >
          aws cloudformation deploy
          --output json
          --region eu-west-1
          --no-fail-on-empty-changeset
          --template-file CFtemplates/Template.template
          --stack-name stack-x
          --parameter-overrides
          Key1=Value1 Key2=Value2

@carolynvs
Copy link
Member

@TheeJamesLee I believe that this has been fixed now in porter v0.25.0-beta.1 and the aws mixin v0.3.0-beta.1 which were just released this week. 🤞

Install the latest version of porter, verify that you now have the the latest aws mixin version (installing porter will install the latest version of the mixin) and give it a go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants