Skip to content

Conversation

Y-JayKim
Copy link
Contributor

Issue # (if applicable)

Closes #34179

Reason for this change

The current implementation throws an error when an IPAM pool's locale is not in the operating regions, even though locale is an optional field in CloudFormation. However, according to AWS documentation, while locale is optional, if it is specified it must be one of the operating regions.

Description of changes

  • Kept the locale validation check conditional on poolOptions.locale being provided, since locale is an optional field
  • Changed the error message to be more descriptive about the requirement that locale must be configured as an operating region when specified
  • Maintained strict validation when locale is provided to match AWS CloudFormation's behavior where it will error if the locale is not in operating regions
  • Updated code comments to better reflect AWS's requirements

The key design decision was to keep the error throw (rather than changing to a warning) because:

  1. CloudFormation will fail if locale isn't in operating regions
  2. It's better to catch this at the CDK level with a clear error message
  3. This matches AWS's documented behaviour

Describe any new or updated permissions being added

No new or updated IAM permissions are required for this change.

Description of how you validated changes

The changes maintain the existing behavior when locale is provided but improve the error message clarity. No new test cases were needed as this is a refinement of error handling rather than a functional change.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team April 24, 2025 18:17
@github-actions github-actions bot added bug This issue is a bug. p2 labels Apr 24, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 24, 2025
@shikha372 shikha372 self-assigned this Apr 24, 2025
@Y-JayKim Y-JayKim changed the title chore: check IPAM Pool local in Operating Region only if specified chore(ec2-alpha): check IPAM Pool local in Operating Region only if specified Apr 24, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 24, 2025
Copy link
Contributor

mergify bot commented Apr 24, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 24, 2025
Copy link
Contributor

mergify bot commented Apr 24, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 97cd0f1
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Apr 24, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit d47b7b0 into aws:main Apr 24, 2025
14 of 15 checks passed
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(@aws-cdk/aws-ec2-alpha): Optional locale on IPAM pool is not optional
3 participants