diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/README.md b/packages/@aws-cdk/aws-servicecatalogappregistry/README.md index 867803c159594..20e0f416d17cc 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/README.md +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/README.md @@ -126,22 +126,6 @@ import * as cdk from "@aws-cdk/core"; const app = new App(); -class CustomAppRegistryAttributeGroup extends cdk.Stack { - public readonly attributeGroup: appreg.AttributeGroup - constructor(scope: Construct, id: string, props?: cdk.StackProps) { - super(scope, id, props); - const myAttributeGroup = new appreg.AttributeGroup(app, 'MyFirstAttributeGroup', { - attributeGroupName: 'MyAttributeGroupName', - description: 'Test attribute group', - attributes: {}, - }); - - this.attributeGroup = myAttributeGroup; - } -} - -const customAttributeGroup = new CustomAppRegistryAttributeGroup(app, 'AppRegistryAttributeGroup'); - const associatedApp = new appreg.ApplicationAssociator(app, 'AssociatedApplication', { applications: [appreg.TargetApplication.createApplicationStack({ applicationName: 'MyAssociatedApplication', @@ -154,7 +138,11 @@ const associatedApp = new appreg.ApplicationAssociator(app, 'AssociatedApplicati }); // Associate application to the attribute group. -customAttributeGroup.attributeGroup.associateWith(associatedApp.appRegistryApplication()); +associatedApp.appRegistryApplication.addAttributeGroup('MyAttributeGroup' , { + attributeGroupName: 'MyAttributeGroupName', + description: 'Test attribute group', + attributes: {}, +}); ``` diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application-associator.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application-associator.ts index ecb17fc924f43..7c8ae60bc8e3e 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application-associator.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application-associator.ts @@ -77,7 +77,7 @@ export class ApplicationAssociator extends Construct { * Get the AppRegistry application. * */ - public appRegistryApplication(): IApplication { + public get appRegistryApplication(): IApplication { return this.application; } } diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application.ts index b630e1a883fb9..e5165676eb0da 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/application.ts @@ -3,7 +3,7 @@ import * as cdk from '@aws-cdk/core'; import { Names } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { StageStackAssociator } from './aspects/stack-associator'; -import { IAttributeGroup } from './attribute-group'; +import { AttributeGroup, IAttributeGroup } from './attribute-group'; import { getPrincipalsforSharing, hashValues, ShareOptions, SharePermission } from './common'; import { isAccountUnresolved } from './private/utils'; import { InputValidator } from './private/validation'; @@ -12,6 +12,29 @@ import { CfnApplication, CfnAttributeGroupAssociation, CfnResourceAssociation } const APPLICATION_READ_ONLY_RAM_PERMISSION_ARN = 'arn:aws:ram::aws:permission/AWSRAMPermissionServiceCatalogAppRegistryApplicationReadOnly'; const APPLICATION_ALLOW_ACCESS_RAM_PERMISSION_ARN = 'arn:aws:ram::aws:permission/AWSRAMPermissionServiceCatalogAppRegistryApplicationAllowAssociation'; +/** + * Properties for a Service Catalog AppRegistry Attribute Group + */ +export interface AttributeGroupAssociationProps { + /** + * Name for attribute group. + * + */ + readonly attributeGroupName: string; + + /** + * Description for attribute group. + * @default - No description provided + */ + readonly description?: string; + + /** + * A JSON of nested key-value pairs that represent the attributes in the group. + * Attributes maybe an empty JSON '{}', but must be explicitly stated. + */ + readonly attributes: { [key: string]: any }; +} + /** * A Service Catalog AppRegistry Application. */ @@ -41,6 +64,14 @@ export interface IApplication extends cdk.IResource { */ associateAttributeGroup(attributeGroup: IAttributeGroup): void; + /** + * Create an attribute group and associate this application with the created attribute group. + * + * @param id name of the AttributeGroup construct to be created. + * @param attributeGroupProps AppRegistry attribute group props + */ + addAttributeGroup(id: string, attributeGroupProps: AttributeGroupAssociationProps): IAttributeGroup; + /** * Associate this application with a CloudFormation stack. * @@ -114,6 +145,23 @@ 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 attributeGroup = new AttributeGroup(this, id, { + attributeGroupName: props.attributeGroupName, + attributes: props.attributes, + description: props.description, + }); + new CfnAttributeGroupAssociation(this, `AttributeGroupAssociation${this.generateUniqueHash(attributeGroup.node.addr)}`, { + application: this.applicationId, + attributeGroup: attributeGroup.attributeGroupId, + }); + this.associatedAttributeGroups.add(attributeGroup.node.addr); + return attributeGroup; + } + /** * Associate a stack with the application * If the resource is already associated, it will ignore duplicate request. diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/aspects/stack-associator.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/aspects/stack-associator.ts index 25549c048937b..b6e81403d86ea 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/aspects/stack-associator.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/aspects/stack-associator.ts @@ -132,7 +132,7 @@ export class CheckedStageStackAssociator extends StackAssociatorBase { constructor(app: ApplicationAssociator, props?: StackAssociatorBaseProps) { super(props); - this.application = app.appRegistryApplication(); + this.application = app.appRegistryApplication; this.applicationAssociator = app; } } diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/target-application.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/target-application.ts index a336f72a9df0e..e2e0bb124b57a 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/lib/target-application.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/lib/target-application.ts @@ -45,7 +45,7 @@ export interface CreateTargetApplicationOptions extends TargetApplicationCommonO /** * Whether create cloudFormation Output for application manager URL. * - * @default - Application containing stacks deployed via CDK. + * @default - true */ readonly emitApplicationManagerUrlAsOutput?: boolean; } diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application-associator.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application-associator.test.ts index e6b43fce35dab..db2540a32b7ba 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application-associator.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application-associator.test.ts @@ -23,12 +23,12 @@ describe('Scope based Associations with Application within Same Account', () => }); const anotherStack = new AppRegistrySampleStack(app, 'SampleStack'); - Template.fromStack(appAssociator.appRegistryApplication().stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::Application', 1); - Template.fromStack(appAssociator.appRegistryApplication().stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(appAssociator.appRegistryApplication.stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::Application', 1); + Template.fromStack(appAssociator.appRegistryApplication.stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Name: 'MyAssociatedApplication', Tags: { managedBy: 'CDK_Application_Associator' }, }); - Template.fromStack(appAssociator.appRegistryApplication().stack).hasOutput('DefaultCdkApplicationApplicationManagerUrl27C138EF', {}); + Template.fromStack(appAssociator.appRegistryApplication.stack).hasOutput('DefaultCdkApplicationApplicationManagerUrl27C138EF', {}); Template.fromStack(anotherStack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); Template.fromStack(anotherStack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::ResourceAssociation', { Application: 'MyAssociatedApplication', @@ -46,14 +46,14 @@ describe('Scope based Associations with Application within Same Account', () => }); const anotherStack = new AppRegistrySampleStack(app, 'SampleStack'); - Template.fromStack(appAssociator.appRegistryApplication().stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::Application', 1); - Template.fromStack(appAssociator.appRegistryApplication().stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { + Template.fromStack(appAssociator.appRegistryApplication.stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::Application', 1); + Template.fromStack(appAssociator.appRegistryApplication.stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', { Name: 'MyAssociatedApplication', Tags: { managedBy: 'CDK_Application_Associator' }, }); expect( - Template.fromStack(appAssociator.appRegistryApplication().stack) + Template.fromStack(appAssociator.appRegistryApplication.stack) .findOutputs('*', {}), ).toEqual({}); Template.fromStack(anotherStack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); @@ -85,7 +85,7 @@ describe('Associate attribute group with Application', () => { })], }); - customAttributeGroup.attributeGroup.associateWith(appAssociator.appRegistryApplication()); + customAttributeGroup.attributeGroup.associateWith(appAssociator.appRegistryApplication); Template.fromStack(customAttributeGroup.attributeGroup.stack).resourceCountIs('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', 1); Template.fromStack(customAttributeGroup.attributeGroup.stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', { Application: 'TestAssociatedApplication', @@ -137,7 +137,7 @@ describe('Scope based Associations with Application with Cross Region/Account', }); expect( - Template.fromStack(appAssociator.appRegistryApplication().stack).findOutputs('*', {}), + Template.fromStack(appAssociator.appRegistryApplication.stack).findOutputs('*', {}), ).toEqual({}); Template.fromStack(firstStack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); Template.fromStack(nestedStack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); @@ -268,7 +268,7 @@ describe('Scope based Associations with Application with Cross Region/Account', associateStage: true, }); app.synth(); - Template.fromStack(application.appRegistryApplication().stack).hasOutput('DefaultCdkApplicationApplicationManagerUrl27C138EF', {}); + Template.fromStack(application.appRegistryApplication.stack).hasOutput('DefaultCdkApplicationApplicationManagerUrl27C138EF', {}); Template.fromStack(pipelineStack).resourceCountIs('AWS::ServiceCatalogAppRegistry::ResourceAssociation', 1); }); }); diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts index f78afa9d3ca3c..8bc60676081aa 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/application.test.ts @@ -160,6 +160,31 @@ describe('Application', () => { }); }), + test('associate new attribute group', () => { + application.addAttributeGroup('AttributeGroup', { + attributeGroupName: 'AttributeGroupName', + 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: 'AttributeGroupName', + Attributes: {}, + }, + }, + }, + }); + }), + test('duplicate attribute group association are idempotent', () => { const attributeGroup = new appreg.AttributeGroup(stack, 'AttributeGroup', { attributeGroupName: 'attributeGroupName', diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/cdk.out b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/cdk.out index b72fef144f05c..7925065efbcc4 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"30.1.0"} \ No newline at end of file +{"version":"31.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.assets.json b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.assets.json index 9081ac09e1a15..fd7204bdc34c2 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.assets.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.assets.json @@ -1,7 +1,7 @@ { - "version": "30.1.0", + "version": "31.0.0", "files": { - "2332c6df6777cc571585060fa4888d6d3b9ef548aa00dcbfc53fbdde386d7591": { + "5fbf2a286122f4bc412b1730f96351e289444b1122006f36e4ade8fae8442765": { "source": { "path": "integ-servicecatalogappregistry-application.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2332c6df6777cc571585060fa4888d6d3b9ef548aa00dcbfc53fbdde386d7591.json", + "objectKey": "5fbf2a286122f4bc412b1730f96351e289444b1122006f36e4ade8fae8442765.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.template.json b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.template.json index 9fcf50e708a56..db928079d96ac 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.template.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ-servicecatalogappregistry-application.template.json @@ -39,10 +39,50 @@ } } }, - "TestApplicationRAMSharead8ba81b8cdd40199FD1": { + "TestApplicationmyAnotherAttributeGroup375F79DB": { + "Type": "AWS::ServiceCatalogAppRegistry::AttributeGroup", + "Properties": { + "Attributes": { + "stage": "alpha", + "teamMembers": [ + "markI", + "markII", + "markIII" + ], + "public": false, + "publishYear": 2021, + "plannedRoadMap": { + "alpha": "some time", + "beta": "another time", + "gamma": "penultimate time", + "release": "go time" + } + }, + "Name": "myAnotherAttributeGroup", + "Description": "my another attribute group description" + } + }, + "TestApplicationAttributeGroupAssociationb6f47e836a8c4FCAC29E": { + "Type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation", + "Properties": { + "Application": { + "Fn::GetAtt": [ + "TestApplication2FBC585F", + "Id" + ] + }, + "AttributeGroup": { + "Fn::GetAtt": [ + "TestApplicationmyAnotherAttributeGroup375F79DB", + "Id" + ] + } + } + }, + "TestApplicationRAMShare004736f08f8e57044D5D": { "Type": "AWS::RAM::ResourceShare", "Properties": { - "Name": "RAMSharead8ba81b8cdd", + "Name": "RAMShare004736f08f8e", "AllowExternalPrincipals": false, "PermissionArns": [ "arn:aws:ram::aws:permission/AWSRAMPermissionServiceCatalogAppRegistryApplicationReadOnly" diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ.json b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ.json index 519ddfd3c055c..dff088cc3537e 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "30.1.0", + "version": "31.0.0", "testCases": { "integ.application": { "stacks": [ diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/manifest.json b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/manifest.json index 689db41c3804f..65f104d2322af 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "30.1.0", + "version": "31.0.0", "artifacts": { "integ-servicecatalogappregistry-application.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2332c6df6777cc571585060fa4888d6d3b9ef548aa00dcbfc53fbdde386d7591.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5fbf2a286122f4bc412b1730f96351e289444b1122006f36e4ade8fae8442765.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -51,10 +51,22 @@ "data": "TestApplicationAttributeGroupAssociation4ba7f5842818B8EE1C6F" } ], - "/integ-servicecatalogappregistry-application/TestApplication/RAMSharead8ba81b8cdd": [ + "/integ-servicecatalogappregistry-application/TestApplication/myAnotherAttributeGroup/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TestApplicationRAMSharead8ba81b8cdd40199FD1" + "data": "TestApplicationmyAnotherAttributeGroup375F79DB" + } + ], + "/integ-servicecatalogappregistry-application/TestApplication/AttributeGroupAssociationb6f47e836a8c": [ + { + "type": "aws:cdk:logicalId", + "data": "TestApplicationAttributeGroupAssociationb6f47e836a8c4FCAC29E" + } + ], + "/integ-servicecatalogappregistry-application/TestApplication/RAMShare004736f08f8e": [ + { + "type": "aws:cdk:logicalId", + "data": "TestApplicationRAMShare004736f08f8e57044D5D" } ], "/integ-servicecatalogappregistry-application/TestAttributeGroup/Resource": [ @@ -80,6 +92,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "TestApplicationRAMSharead8ba81b8cdd40199FD1": [ + { + "type": "aws:cdk:logicalId", + "data": "TestApplicationRAMSharead8ba81b8cdd40199FD1", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "integ-servicecatalogappregistry-application" diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/tree.json b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/tree.json index ef111bc49a7b8..f55cdb42b5a66 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.js.snapshot/tree.json @@ -75,13 +75,79 @@ "version": "0.0.0" } }, - "RAMSharead8ba81b8cdd": { - "id": "RAMSharead8ba81b8cdd", - "path": "integ-servicecatalogappregistry-application/TestApplication/RAMSharead8ba81b8cdd", + "myAnotherAttributeGroup": { + "id": "myAnotherAttributeGroup", + "path": "integ-servicecatalogappregistry-application/TestApplication/myAnotherAttributeGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-servicecatalogappregistry-application/TestApplication/myAnotherAttributeGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalogAppRegistry::AttributeGroup", + "aws:cdk:cloudformation:props": { + "attributes": { + "stage": "alpha", + "teamMembers": [ + "markI", + "markII", + "markIII" + ], + "public": false, + "publishYear": 2021, + "plannedRoadMap": { + "alpha": "some time", + "beta": "another time", + "gamma": "penultimate time", + "release": "go time" + } + }, + "name": "myAnotherAttributeGroup", + "description": "my another attribute group description" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-servicecatalogappregistry.CfnAttributeGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-servicecatalogappregistry.AttributeGroup", + "version": "0.0.0" + } + }, + "AttributeGroupAssociationb6f47e836a8c": { + "id": "AttributeGroupAssociationb6f47e836a8c", + "path": "integ-servicecatalogappregistry-application/TestApplication/AttributeGroupAssociationb6f47e836a8c", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation", + "aws:cdk:cloudformation:props": { + "application": { + "Fn::GetAtt": [ + "TestApplication2FBC585F", + "Id" + ] + }, + "attributeGroup": { + "Fn::GetAtt": [ + "TestApplicationmyAnotherAttributeGroup375F79DB", + "Id" + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-servicecatalogappregistry.CfnAttributeGroupAssociation", + "version": "0.0.0" + } + }, + "RAMShare004736f08f8e": { + "id": "RAMShare004736f08f8e", + "path": "integ-servicecatalogappregistry-application/TestApplication/RAMShare004736f08f8e", "attributes": { "aws:cdk:cloudformation:type": "AWS::RAM::ResourceShare", "aws:cdk:cloudformation:props": { - "name": "RAMSharead8ba81b8cdd", + "name": "RAMShare004736f08f8e", "allowExternalPrincipals": false, "permissionArns": [ "arn:aws:ram::aws:permission/AWSRAMPermissionServiceCatalogAppRegistryApplicationReadOnly" @@ -241,7 +307,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.252" + "version": "10.1.270" } } }, diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.ts b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.ts index 9635a126e2b05..f44ba7f0a31d7 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.ts +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/test/integ.application.ts @@ -33,6 +33,26 @@ const attributeGroup = new appreg.AttributeGroup(stack, 'TestAttributeGroup', { application.associateStack(stack); application.associateAttributeGroup(attributeGroup); +application.addAttributeGroup('myAnotherAttributeGroup', { + attributeGroupName: 'myAnotherAttributeGroup', + attributes: { + stage: 'alpha', + teamMembers: [ + 'markI', + 'markII', + 'markIII', + ], + public: false, + publishYear: 2021, + plannedRoadMap: { + alpha: 'some time', + beta: 'another time', + gamma: 'penultimate time', + release: 'go time', + }, + }, + description: 'my another attribute group description', +}); const myRole = new iam.Role(stack, 'MyRole', { assumedBy: new iam.AccountPrincipal(stack.account), });