-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-route53: Creating a RecordSet with weight of zero throws an Error #29556
aws-route53: Creating a RecordSet with weight of zero throws an Error #29556
Comments
Thanks for reporting the issue. I could reproduce the error you referenced when setting
|
### Issue # (if applicable) Closes #29556 . ### Reason for this change When creating an ARecord object in Route53 with props.weight set to 0 an Error is thrown. ### Description of changes Change checks for `weight` to use `weight === undefined` instead of `!weight` ### Description of how you validated changes - Added a unit test with `weight: 0` - Updated integ tests to include a record with `weight: 0` ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When creating an ARecord object in Route53 with props.weight set to 0 an Error is thrown.
Expected Behavior
The record would be created with weight zero which is a valid value.
Current Behavior
An Error is thrown:
The issue is that when props.weight = 0, !props.weight in Javascript becomes !0 which evaluates as true.
Reproduction Steps
Create an ARecord object with weight of zero:
And run cdk synth.
Possible Solution
Change
!props.weight
toprops.weight === undefined
.Additional Information/Context
Bug introduced in 1.124
CDK CLI Version
^2.132.1
Framework Version
No response
Node.js Version
18.18.2
OS
Any
Language
TypeScript
Language Version
No response
Other information
The text was updated successfully, but these errors were encountered: