Describe the bug
This change in 2.34.0 forces parsing AWS account ids as numbers.
This breaks code like the following:
func LoadContextValue(scope constructs.Construct, key string) (value string) {
value = fmt.Sprintf("%s", scope.Node().TryGetContext(jsii.String(key)))
log.Printf("%s", value)
if value == "" {
log.Fatalf("FATAL ERROR: missing '%s' context argument", key)
}
return
}
If I run a CDK command e.g. cdk diff -v --context accountID=111111111111 the log output is %!s(float64=1.11111111111e+11).
Expected Behavior
If I run a CDK command e.g. cdk diff -v --context accountID=111111111111, I expect the log output to be 111111111111.
Current Behavior
In 2.33.0, if I run a CDK command e.g. cdk diff -v --context accountID=111111111111, the log output is 111111111111 and I can diff/deploy/destroy stacks successfully.
Reproduction Steps
Run any CDK command that expects a number to be parsed as a string.
In my case, I run cdk diff -v --context accountID=111111111111, but the same issue exists for any CDK command e.g. deploy, destroy etc.
Possible Solution
I suspect this change in 2.34.0 causes the issue.
Additional Information/Context
No response
CDK CLI Version
2.34.0
Framework Version
No response
Node.js Version
v16.13.1
OS
macOS 12.4
Language
Go
Language Version
Go 1.18
Other information
No response
Describe the bug
This change in
2.34.0forces parsing AWS account ids as numbers.This breaks code like the following:
If I run a CDK command e.g.
cdk diff -v --context accountID=111111111111the log output is%!s(float64=1.11111111111e+11).Expected Behavior
If I run a CDK command e.g.
cdk diff -v --context accountID=111111111111, I expect the log output to be111111111111.Current Behavior
In
2.33.0, if I run a CDK command e.g.cdk diff -v --context accountID=111111111111, the log output is111111111111and I can diff/deploy/destroy stacks successfully.Reproduction Steps
Run any CDK command that expects a number to be parsed as a string.
In my case, I run
cdk diff -v --context accountID=111111111111, but the same issue exists for any CDK command e.g.deploy,destroyetc.Possible Solution
I suspect this change in 2.34.0 causes the issue.
Additional Information/Context
No response
CDK CLI Version
2.34.0
Framework Version
No response
Node.js Version
v16.13.1
OS
macOS 12.4
Language
Go
Language Version
Go 1.18
Other information
No response