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

Mappings in template do not maintain quotes during package step #91

Closed
jolexa opened this issue Feb 14, 2017 · 7 comments
Closed

Mappings in template do not maintain quotes during package step #91

jolexa opened this issue Feb 14, 2017 · 7 comments

Comments

@jolexa
Copy link

jolexa commented Feb 14, 2017

Hello, using aws cloudformation package with the following simple snippet results in the loss of quotes which causes a ChangeSet to remain in CREATE_IN_PROGRESS indefinitely in the proper scenerio.

Mappings:
  '1234567890':
    kmskeys:
      'dev': 'arn:aws:kms:us-east-1:1234567890:key/1234567890-abcdefg-1234-1234'
      'test': 'arn:aws:kms:us-east-1:1234567890:key/1234567890-abcdefg-1234-12345'

after the aws cloudformation package step:

Mappings:
  1234567890:
    kmskeys:
      dev: arn:aws:kms:us-east-1:1234567890:key/1234567890-abcdefg-1234-1234
      test: arn:aws:kms:us-east-1:1234567890:key/1234567890-abcdefg-1234-12345

This is a problem because when using the !Ref "AWS::AccountID" function, a string is returned so it will never match the mapping - if you are mapping per AccountID.

Per the docs, if a Mapping is not used, it is an invalid changeset

So, I'm curious if this is a bug. I feel like I should be able to create a Mapping with Account ID's and then reference the AccountID later in a later block and it is currently not possible with aws cloudformation package. Thoughts?

$ aws --version
aws-cli/1.11.47 Python/2.7.10 Darwin/16.0.0 botocore/1.5.10
@jolexa
Copy link
Author

jolexa commented Feb 14, 2017

Upon further review and testing, this problem ONLY exists if your account id starts with 0.

@sanathkr
Copy link
Contributor

Ah interesting. My first guess is that YAML parser/dumper does type conversion which removes types. Need to dig into this further

@sanathkr
Copy link
Contributor

aws/aws-cli#2556 gives you a workaround. You can use --use-json to dump in JSON instead of YAML. We still have aws/aws-cli#2511 open which will end up quoting every single string in output just to be safe.

Does this solve your problem?

@sanathkr sanathkr added the bug label Jun 28, 2017
@jolexa
Copy link
Author

jolexa commented Jul 1, 2017

Sure. I've already made a workaround. If you feel it is sufficient to close this, go ahead. Thanks for the response!

@sanathkr
Copy link
Contributor

sanathkr commented Jul 1, 2017

Sounds good.

@sanathkr sanathkr closed this as completed Jul 1, 2017
@judahb
Copy link

judahb commented Sep 25, 2017

@jolexa What was your workaround?

@jolexa
Copy link
Author

jolexa commented Sep 26, 2017

Using sed in a pre-deployment step. Ugly but quicker than waiting for awscli bugfixes :/

mndeveci pushed a commit that referenced this issue Nov 19, 2021
This change hides the unreleased properties from the "Globals" error message
hawflau added a commit that referenced this issue Apr 6, 2022
* feat: Support for Lambda URL (#86)

* feat: changed CorsConfig property to Cors (#89)

* feat: add list of "unreleased" properties (#91)

This change hides the unreleased properties from the "Globals" error message

* Lambda URL integ test (#94)

* remove functionUrlConfig from the unrelease properties (#97)

* remove functionUrlConfig from the unrelease properties

* updates

* Function Url new changes  (#109)

* update to Function Url

* first update

* reverted to support autopublishing and added validation for AuthType values

* adding Integration test

* fix: fix paths IF intrinsic bug (#107)

* fix: fix paths IF intrinsic bug

* missed bit of code

* add NoValue tests

* review feedback and refactoring

* naming fix

* review feedback naming and comments

* add missing test + add extra check for api key on tests

* integration test updated (#122)

Co-authored-by: jonife <79116465+jonife@users.noreply.github.com>
Co-authored-by: Renato Valenzuela <37676028+valerena@users.noreply.github.com>
Co-authored-by: Ruperto Torres <86501267+torresxb1@users.noreply.github.com>
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

No branches or pull requests

3 participants