-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cloudfront): Send zero instead of nil during create/update
Signed-off-by: Jorge Millán <[email protected]> This is related to #1210, the issue is arised due to the usage of the function `ToIntAsInt64` returns nil when the value is `0`. Since the AWS API for CloudFront expects an actual "Quantity: 0" value, returning nil makes the API complain with something like: ``` create failed: cannot create Distribution in AWS: InvalidParameter: 10 validation error(s) found. - missing required field, CreateDistributionInput.DistributionConfig.CacheBehaviors.Quantity. - missing required field, CreateDistributionInput.DistributionConfig.CustomErrorResponses.Quantity. ... ``` This creates the utility function `ToIntAsInt64Zero` to allow the value `0` to be converted, thus fulfilling the requirement for the CloudFront API to have a real value, even if is zero.
- Loading branch information
Showing
2 changed files
with
64 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters