(aws-bedrock-agentcore-alpha): Make physical name properties optional for all resources
Describe the feature
All AWS Bedrock AgentCore constructs currently require physical name properties to be specified. These should be made optional, allowing CDK to automatically generate unique physical names when not specified, following AWS CDK best practices.
According to the AWS CDK Best Practices guide:
"Use generated resource names, not physical names"
Use Case
Making physical names optional provides several benefits:
-
Stack reusability: Required physical names make it difficult to deploy the same stack across multiple environments (dev, staging, production) without code changes.
-
Avoid naming conflicts: Auto-generated names guarantee uniqueness across stacks and environments.
Proposed Solution
Make physical name properties optional in all AgentCore resource Props interfaces and auto-generate names using Names.uniqueResourceName() when not specified.
Other Information
No response
Acknowledgements
- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
AWS CDK Library version (aws-cdk-lib)
all
AWS CDK CLI version
all
Environment details (OS name and version, etc.)
all
Hi @mazyu36,
Thank you for this excellent feature request and for already submitting PR #36354! This is a valuable improvement that aligns the Bedrock AgentCore constructs with AWS CDK best practices.
Your analysis is spot-on - making physical names optional provides significant benefits:
- Stack reusability across environments without code changes
- Automatic uniqueness guarantees via CDK's name generation
- Best practice alignment with the CDK guidance on generated resource names
I've reviewed your PR implementation and the approach looks solid:
- ✅ Props interfaces updated to make physical names optional
- ✅ Proper use of ResourceProps with physicalName in base class constructors
- ✅ Auto-generation using Names.uniqueResourceName() with appropriate maxLength constraints
- ✅ Comprehensive test coverage for all affected resources
- ✅ README documentation updates
The implementation correctly handles all seven AgentCore resource types:
This change is backward compatible since existing code with explicit names will continue to work. Once the PR description is completed and tests pass, this should be ready for review by the CDK team.
Great contribution! 🎉