Skip to content

Conversation

naaa760
Copy link

@naaa760 naaa760 commented Sep 23, 2025

Closes #35524.

Reason for this change

  • The current fromAttributeGroupArn method only creates a reference to an existing AttributeGroup but doesn't provide access to the stored attributes. This limits the usefulness of AttributeGroups as a centralized configuration store, forcing users to use SSM parameters for sharing configuration objects across multiple accounts.

Description of changes

  • Added an optional attributes parameter to the fromAttributeGroupArn method and added an attributes property to the IAttributeGroup interface. This allows users to provide attributes when importing an AttributeGroup, enabling access to stored configuration data.

Changes made:

  • Added attributes?: { [key: string]: any } property to IAttributeGroup interface
  • Added attributes property to AttributeGroupBase abstract class
  • Updated fromAttributeGroupArn method signature to accept optional attributes parameter
  • Added attributes property to concrete AttributeGroup class
  • Updated constructor to set the attributes property from props

Design decisions:

  • Made attributes optional to maintain backward compatibility
  • Used the same type { [key: string]: any } as the existing AttributeGroupProps.attributes
  • No breaking changes to existing API

Describe any new or updated permissions being added

  • No new IAM permissions are required. This change only affects the CDK construct interface and doesn't modify AWS resource permissions.

Description of how you validated changes

  • Added unit tests to verify importing AttributeGroup with and without attributes
  • Added test to verify accessing attributes from newly created AttributeGroup
  • All existing tests continue to pass, ensuring backward compatibility

@aws-cdk-automation aws-cdk-automation requested a review from a team September 23, 2025 08:02
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Sep 23, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.
❌ The title scope of the pull request should omit 'aws-' from the name of modified packages. Use 'servicecatalogappregistry-alpha' instead of 'aws-servicecatalogappregistry-alpha'.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@naaa760
Copy link
Author

naaa760 commented Sep 29, 2025

Hello @pahud
would you please review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-servicecatalogappregistry-alpha): Add retrieving of attributes from construct
2 participants