question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to enforce string on input

See original GitHub issue
                
                self.template.add_resource(VPCPeeringConnection(
                    title,
                    VpcId=peering_config['VpcId'],
                    PeerVpcId=peering_config['TargetVpcId'],
                    PeerOwnerId=peering_config['TargetAccountId'],
                    PeerRoleArn=peering_config['TargetRoleArn'],
                    Tags=Tags(
                        Name=title
                    )
                ))

as account ID is 1234567890 format. the Account ID keep written as Number instead of String. this cause cloudformation complain about the value


[2018-03-05 16:36:47] - sceptre.stack - 2018-03-05T03:36:47+00:00 prod/cross-account-vpc-peering ProdVpcToDev AWS::EC2::VPCPeeringConnection CREATE_FAILED Invalid value '1.234567890E10' for peerOwnerId.

even if i use str() to convert it. it still written as number in yaml output

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
stilvoidcommented, Mar 12, 2018

So I’ve been looking into this issue for a while and I think the issue might actually lie with CloudFormation but probably for a good reason.

Take, for example, the sequence: 012345678. The yaml spec (v1.1, it’s fixed in v1.2) says that octal numbers start with a 0. But this sequence isn’t valid octal because it contains 8 so most yaml parsers interpret this as a string. CloudFormation does not and (possible incorrectly) tries to interpret it as a number. This is wrong from the point of view of the yaml spec but probably correct from a safety point of view.

Fixing this in cfn-flip is going to be interesting but I’ll continue to look into it.

If you have any ideas, please submit a PR 😄

0reactions
stilvoidcommented, Mar 12, 2018

Ok. Fixed in cfn-flip>=1.0.2 😃

PR here: https://github.com/cloudtools/troposphere/pull/1003

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML input type="number" still returning a string when ...
When you set input type="number" then these input field don't accept non numeric input but at the same time it doesn't make the...
Read more >
Input String Was Not in a Correct Format: Easy Fixes
Input string was not in a correct format warning mainly occurs when you try to convert a non-numeric string into an int. Read...
Read more >
Input string was not in a correct format error when importing ...
When you import a solution in Microsoft Dynamics 365, you receive an error that states input string was not in a correct format...
Read more >
Error handling in Step Functions - AWS Documentation
The Amazon States Language defines a set of built-in strings that name ... Step Functions failed to apply a state's ResultPath field to...
Read more >
Error: “Input string was not in a correct format”
If you are unable to start the Alteryx Service on a node that isnot the Controller, see Solution B. Had there been any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found