-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Serverless Transform with YAML removes leading 0 in account number field. #1469
Comments
You defined the Account as an Number, but it must be a String. |
I tested this with a similar account number starting with a leading zero. If I run it through SAM, the account number does not load correctly. I can double quote, single quote or no quote the account number and I get the same error. If I remove the Transform and upload template through cloudformation (double quoted), it works. Could it be that during the transform, it is converting to an number? |
@brjonath this is a known issue in CloudFormation. See #200 (comment) for more information regarding this bug and possible workarounds. Closing in favor of #200. |
Not every YAML parser distinguishes between unquoted string literals the same way: - kubernetes/kubernetes#82296 - https://blog.rowanudell.com/aws-accounts-with-leading-zeros/ - aws/serverless-application-model#1469 - hashicorp/terraform-provider-aws#15310 This PR forces strings like `088579281390` to be rendered as quoted `'088579281390'`. While this is not strictly necessary, there are several YAML parsers which mis-handle this kind of output, and so we ensure things are quoted to avoid triggering this edge case. Added a unit test that on master fails due to generation of non-quoted octal-like strings, and on this PR passes with all strings quoted
Description:
When submitting a template to 'AWS::Serverless-2016-10-31' Transform where template has a resource's property corresponding to account number with a leading zero '0', the transfrom just remove this zero '0' and processed template returened by this transform ends up having a wrong account number.
Observations:
Replication:
TestBucket -> Properties -> ReplicationConfiguration -> Rules -> Description -> Account
The text was updated successfully, but these errors were encountered: