Skip to content
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

[Backport release-0.50] fix(cloudfront): Send zero instead of nil during create/update #2119

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Nov 4, 2024

Description

Backport of #2117 to release-0.50.

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.

(cherry picked from commit 6e5d322)
@MisterMX MisterMX merged commit 2236008 into release-0.50 Nov 4, 2024
10 checks passed
@MisterMX MisterMX deleted the backport-2117-to-release-0.50 branch November 4, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants