Skip to content

Commit

Permalink
Make attribute group name as required.
Browse files Browse the repository at this point in the history
<body>

Testing done
-------------------------------------
*

Related items
------------------------------------
* SIM/auto-cut ticket
  • Loading branch information
liwewang-amazon committed Mar 21, 2023
1 parent 073b867 commit e4e9095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const APPLICATION_ALLOW_ACCESS_RAM_PERMISSION_ARN = 'arn:aws:ram::aws:permission
*/
export interface AttributeGroupAssociationProps {
/**
* Enforces a particular physical attribute group name.
* @default The value of `id` will be used as attribute group name
* name for attribute group.
*
*/
readonly attributeGroupName?: string;
readonly attributeGroupName: string;

/**
* Description for attribute group.
Expand Down Expand Up @@ -149,9 +149,8 @@ abstract class ApplicationBase extends cdk.Resource implements IApplication {
* Create an attribute group and associate this application with the created attribute group.
*/
public addAttributeGroup(id: string, props: AttributeGroupAssociationProps): IAttributeGroup {
const attributeGroupName = props.attributeGroupName ?? id;
const attributeGroup = new AttributeGroup(this, id, {
attributeGroupName: attributeGroupName,
attributeGroupName: props.attributeGroupName,
attributes: props.attributes,
description: props.description,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,6 @@ describe('Application', () => {
}),

test('associate new attribute group', () => {
application.addAttributeGroup('AttributeGroup', {
attributes: {},
description: 'Description for Attribute Group',
});

Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', {
Application: { 'Fn::GetAtt': ['MyApplication5C63EC1D', 'Id'] },
AttributeGroup: { 'Fn::GetAtt': ['MyApplicationAttributeGroup0BD166B6', 'Id'] },
});

Template.fromStack(stack).templateMatches({
Resources: {
MyApplicationAttributeGroup0BD166B6: {
Type: 'AWS::ServiceCatalogAppRegistry::AttributeGroup',
Properties: {
Name: 'AttributeGroup',
Attributes: {},
},
},
},
});
}),

test('associate new attribute group with name', () => {
application.addAttributeGroup('AttributeGroup', {
attributeGroupName: 'AttributeGroupName',
attributes: {},
Expand Down

0 comments on commit e4e9095

Please sign in to comment.