realestate-com-au / stackup

a simple CLI and Ruby API for AWS CloudFormation
MIT License
97 stars 34 forks source link

Updating stack using --tags option, ArgumentError #25

Closed robert2d closed 8 years ago

robert2d commented 8 years ago

All thats needed to re-create this error is an existing stack that you want to update using the --tags argument as a file path. When running the command below there is an error in the AWS sdk. Really annoying cause the stack level tags are great!

I know this isn't an issue with stackup, but was hoping those who created this might be able to debug better than I can. Going into the param_validator.rb and trying to chase down the seahorse shape stuff is head ache inducing.

I have had to resort back to manually tagging resources for now. Creating the stack works perfectly its just the update that is raising.

trace:

/Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/aws-sdk-core/param_validator.rb:26:in `validate!': unexpected value at params[:tags] (ArgumentError)
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/aws-sdk-core/param_validator.rb:11:in `validate!'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/aws-sdk-core/plugins/param_validator.rb:20:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/aws-sdk-core/plugins/logging.rb:39:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/aws-sdk-core/plugins/param_converter.rb:20:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/seahorse/client/plugins/response_target.rb:21:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/seahorse/client/request.rb:70:in `send_request'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.2.18/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-resources-2.2.18/lib/aws-sdk-resources/request.rb:24:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-resources-2.2.18/lib/aws-sdk-resources/operations.rb:41:in `call'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/aws-sdk-resources-2.2.18/lib/aws-sdk-resources/operation_methods.rb:19:in `block in add_operation'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:264:in `block in update'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:293:in `block (2 levels) in modify_stack'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/error_handling.rb:16:in `handling_validation_error'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:292:in `block in modify_stack'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:232:in `watch'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:291:in `modify_stack'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:263:in `update'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/lib/stackup/stack.rb:120:in `create_or_update'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:147:in `block in execute'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:92:in `report_change'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:146:in `execute'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:50:in `run'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:50:in `run'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/clamp-1.0.0/lib/clamp.rb:6:in `Clamp'
    from /Users/dave/.rvm/gems/ruby-2.3.1/gems/stackup-0.8.2/bin/stackup:16:in `<top (required)>'
    from /Users/dave/.rvm/gems/ruby-2.3.1/bin/stackup:23:in `load'
    from /Users/dave/.rvm/gems/ruby-2.3.1/bin/stackup:23:in `<main>'
    from /Users/dave/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/dave/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

command:

bundle exec stackup ${APP} up \
  -t ${APP}.json \
  -p ${DEPLOY_ENV}.params.json \
  --tags tags.json \
  --region ${AWS_REGION}
mdub commented 8 years ago

Hey Robbo!

Update of stack tags is a feature that was added to CloudFormation fairly recently; the version of aws-sdk-core you're using might not know about it.

Can you upgrade aws-sdk-core (e.g. to "2.3.12"), and try again?

robert2d commented 8 years ago

Yea I just thought about that after clicking submit. Attempting now

robert2d commented 8 years ago

yep my bad!

robert2d commented 8 years ago

Hey Mike! hope all is well over the Tasman BTW.

We have this gem in quite a few projects now FWIW. Its sooooo good!

mdub commented 8 years ago

👍 Thanks! Consider it REA's leaving gift to you. :-)