aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

feat(route53resolver): improve FirewallRuleGroup import by name

Open aditya-shrey opened this issue 9 months ago • 2 comments

Issue

Closes #16335.

Reason for this change

Currently, FirewallRuleGroup allows importing an existing rule group by ID using fromFirewallRuleGroupID(), but there is no built-in way to reference an existing rule group by name. Users need to implement their own lookup logic via the AWS SDK. This change provides a direct method to import a firewall rule group by name, simplifying the process.

Description of changes

  • Added FirewallRuleGroup.fromFirewallRuleGroupName(), which allows users to import a firewall rule group using its name instead of just an ID.
  • The method retrieves the rule group ID from the CDK context.
  • If the provided firewall rule group name is not found in the context, it throws a meaningful error.
  • Created unit tests, ensuring correct ID is returned when a valid name mapping is provided in the context and an error is thrown if firewall rule group name is not found in the context.

Describe any new or updated permissions being added

None

Description of how you validated changes

  • Unit Tests: Added tests in firewall-rule-group.test.ts to validate both successful and failing cases.
  • Integration Tests: Updated integration.firewall.js to reflect changes and updated snapshots.

Checklist

Acknowledgements

Thanks to @arvchahal for collaboration on this feature!


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

aditya-shrey avatar Mar 15 '25 08:03 aditya-shrey

AWS CodeBuild CI Report

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

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

aws-cdk-automation avatar Mar 15 '25 09:03 aws-cdk-automation

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing

To prevent automatic closure:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

aws-cdk-automation avatar Jun 13 '25 00:06 aws-cdk-automation

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

aws-cdk-automation avatar Jun 27 '25 00:06 aws-cdk-automation

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[bot] avatar Jun 27 '25 00:06 github-actions[bot]