Skip to content

Commit e22df7a

Browse files
committed
Update to version v3.1.0
1 parent f616d63 commit e22df7a

8 files changed

+298
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.1.0] - 2022-11-10
9+
10+
### Added
11+
12+
- Added AppRegistryAWS Service Catalog AppRegistry support for all deployments of the solution.
13+
- Due to current limitations of AppRegistry, a separate instance of AppRegistry is launched for each region that this solution is deployed to.
14+
815
## [3.0.0] - 2022-08-24
916

1017
⚠ BREAKING CHANGES

source/infrastructure/lib/common-resources/common-resources.ts

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { CfnResource, RemovalPolicy, Stack } from 'aws-cdk-lib';
4+
import { Aws, CfnResource, Fn, RemovalPolicy, Stack, Tags } from 'aws-cdk-lib';
55
import { BlockPublicAccess, Bucket, BucketAccessControl, BucketEncryption, IBucket } from 'aws-cdk-lib/aws-s3';
66
import { AnyPrincipal, Effect, Policy, PolicyStatement } from 'aws-cdk-lib/aws-iam';
7+
import * as appreg from '@aws-cdk/aws-servicecatalogappregistry-alpha'
78
import { Construct } from 'constructs';
89

910
export interface CommonResourcesConstructProps {
1011
readonly sourceCodeBucket: string;
1112
}
1213

14+
export interface AppRegistryApplicationProps {
15+
readonly description: string;
16+
readonly stackType: string;
17+
readonly solutionId: string;
18+
readonly applicationName: string;
19+
readonly solutionVersion: string;
20+
}
21+
1322
/**
1423
* Distributed Load Testing on AWS common resources construct.
1524
* Creates a CloudWatch logs policy and an S3 bucket to store logs.
@@ -20,7 +29,6 @@ export class CommonResourcesConstruct extends Construct {
2029
// Code S3 Bucket
2130
public sourceBucket: IBucket;
2231

23-
2432
constructor(scope: Construct, id: string, props: CommonResourcesConstructProps) {
2533
super(scope, id);
2634

@@ -68,8 +76,40 @@ export class CommonResourcesConstruct extends Construct {
6876
rules_to_suppress: [{
6977
id: 'W35',
7078
reason: 'This is the logging bucket, it does not require logging.'
79+
}, {
80+
id: 'W51',
81+
reason: 'Since the bucket does not allow the public access, it does not require to have bucket policy.'
7182
}]
7283
});
7384
return logsBucket;
7485
}
75-
}
86+
87+
public appRegistryApplication(props: AppRegistryApplicationProps) {
88+
const stack = Stack.of(this);
89+
const applicationType = "AWS-Solutions";
90+
const solutionName = "Distributed Load Testing";
91+
92+
const application = new appreg.Application(stack, "AppRegistry", {
93+
applicationName: Fn.join("-", [props.applicationName, Aws.REGION, Aws.ACCOUNT_ID]),
94+
description: `Service Catalog application to track and manage all your resources for the solution ${solutionName}`,
95+
});
96+
application.associateStack(stack);
97+
98+
Tags.of(application).add("Solutions:SolutionID", props.solutionId);
99+
Tags.of(application).add("Solutions:SolutionName", solutionName);
100+
Tags.of(application).add("Solutions:SolutionVersion", props.solutionVersion);
101+
Tags.of(application).add("Solutions:ApplicationType", applicationType);
102+
103+
const attributeGroup = new appreg.AttributeGroup(stack, "DefaultApplicationAttributes", {
104+
attributeGroupName: Aws.STACK_NAME,
105+
description: "Attribute group for solution information",
106+
attributes: {
107+
applicationType: applicationType,
108+
version: props.solutionVersion,
109+
solutionID: props.solutionId,
110+
solutionName: solutionName,
111+
},
112+
});
113+
application.associateAttributeGroup(attributeGroup);
114+
}
115+
}

source/infrastructure/lib/distributed-load-testing-on-aws-regional-stack.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ export class RegionalInfrastructureDLTStack extends Stack {
306306
sendAnonymousUsageCondition
307307
});
308308

309+
commonResources.appRegistryApplication({
310+
description: props.description,
311+
solutionVersion: solutionVersion,
312+
stackType: props.stackType,
313+
solutionId: solutionId,
314+
applicationName: props.solutionName
315+
});
316+
309317
// Outputs
310318
new CfnOutput(this, 'ECSCloudWatchLogGroup', {
311319
description: 'The CloudWatch log group for ECS',

source/infrastructure/lib/distributed-load-testing-on-aws-stack.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,14 @@ export class DLTStack extends Stack {
459459
sendAnonymousUsageCondition
460460
});
461461

462+
commonResources.appRegistryApplication({
463+
description: props.description,
464+
solutionVersion: solutionVersion,
465+
stackType: props.stackType,
466+
solutionId: solutionId,
467+
applicationName: props.solutionName
468+
});
469+
462470
//Outputs
463471
new CfnOutput(this, 'Console', {
464472
description: 'Console URL',

source/infrastructure/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"devDependencies": {
1515
"@aws-cdk/assert": "2.23.0",
1616
"@aws-solutions-constructs/aws-cloudfront-s3": "2.8.0",
17+
"@aws-cdk/aws-servicecatalogappregistry-alpha": "2.39.1-alpha.0",
1718
"aws-cdk": "2.23.0",
1819
"aws-cdk-lib": "2.23.0",
1920
"constructs": "10.1.23",

source/infrastructure/test/__snapshots__/distributed-load-testing-on-aws-regional.test.ts.snap

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,83 @@ Object {
166166
},
167167
},
168168
"Resources": Object {
169+
"AppRegistry968496A3": Object {
170+
"Properties": Object {
171+
"Description": "Service Catalog application to track and manage all your resources for the solution Distributed Load Testing",
172+
"Name": Object {
173+
"Fn::Join": Array [
174+
"-",
175+
Array [
176+
"distributed-load-testing-on-aws",
177+
Object {
178+
"Ref": "AWS::Region",
179+
},
180+
Object {
181+
"Ref": "AWS::AccountId",
182+
},
183+
],
184+
],
185+
},
186+
"Tags": Object {
187+
"SolutionId": Object {
188+
"Fn::FindInMap": Array [
189+
"Solution",
190+
"Config",
191+
"SolutionId",
192+
],
193+
},
194+
"Solutions:ApplicationType": "AWS-Solutions",
195+
"Solutions:SolutionID": Object {
196+
"Fn::FindInMap": Array [
197+
"Solution",
198+
"Config",
199+
"SolutionId",
200+
],
201+
},
202+
"Solutions:SolutionName": "Distributed Load Testing",
203+
"Solutions:SolutionVersion": Object {
204+
"Fn::FindInMap": Array [
205+
"Solution",
206+
"Config",
207+
"CodeVersion",
208+
],
209+
},
210+
},
211+
},
212+
"Type": "AWS::ServiceCatalogAppRegistry::Application",
213+
},
214+
"AppRegistryAttributeGroupAssociationa7177d48be75C139509C": Object {
215+
"Properties": Object {
216+
"Application": Object {
217+
"Fn::GetAtt": Array [
218+
"AppRegistry968496A3",
219+
"Id",
220+
],
221+
},
222+
"AttributeGroup": Object {
223+
"Fn::GetAtt": Array [
224+
"DefaultApplicationAttributesFC1CC26B",
225+
"Id",
226+
],
227+
},
228+
},
229+
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation",
230+
},
231+
"AppRegistryResourceAssociation017832cce413582276C2": Object {
232+
"Properties": Object {
233+
"Application": Object {
234+
"Fn::GetAtt": Array [
235+
"AppRegistry968496A3",
236+
"Id",
237+
],
238+
},
239+
"Resource": Object {
240+
"Ref": "AWS::StackId",
241+
},
242+
"ResourceType": "CFN_STACK",
243+
},
244+
"Type": "AWS::ServiceCatalogAppRegistry::ResourceAssociation",
245+
},
169246
"CommonResourcesCloudWatchLogsPolicyB8257A4C": Object {
170247
"Properties": Object {
171248
"PolicyDocument": Object {
@@ -878,6 +955,42 @@ Object {
878955
},
879956
"Type": "AWS::EC2::Subnet",
880957
},
958+
"DefaultApplicationAttributesFC1CC26B": Object {
959+
"Properties": Object {
960+
"Attributes": Object {
961+
"applicationType": "AWS-Solutions",
962+
"solutionID": Object {
963+
"Fn::FindInMap": Array [
964+
"Solution",
965+
"Config",
966+
"SolutionId",
967+
],
968+
},
969+
"solutionName": "Distributed Load Testing",
970+
"version": Object {
971+
"Fn::FindInMap": Array [
972+
"Solution",
973+
"Config",
974+
"CodeVersion",
975+
],
976+
},
977+
},
978+
"Description": "Attribute group for solution information",
979+
"Name": Object {
980+
"Ref": "AWS::StackName",
981+
},
982+
"Tags": Object {
983+
"SolutionId": Object {
984+
"Fn::FindInMap": Array [
985+
"Solution",
986+
"Config",
987+
"SolutionId",
988+
],
989+
},
990+
},
991+
},
992+
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroup",
993+
},
881994
"RealTimeDataRealTimeDataPublisher7E8F8F6C": Object {
882995
"DependsOn": Array [
883996
"RealTimeDatarealTimeDataPublisherRoleA8976D01",

source/infrastructure/test/__snapshots__/distributed-load-testing-on-aws-stack.test.ts.snap

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,83 @@ Object {
347347
},
348348
},
349349
"Resources": Object {
350+
"AppRegistry968496A3": Object {
351+
"Properties": Object {
352+
"Description": "Service Catalog application to track and manage all your resources for the solution Distributed Load Testing",
353+
"Name": Object {
354+
"Fn::Join": Array [
355+
"-",
356+
Array [
357+
"distributed-load-testing-on-aws",
358+
Object {
359+
"Ref": "AWS::Region",
360+
},
361+
Object {
362+
"Ref": "AWS::AccountId",
363+
},
364+
],
365+
],
366+
},
367+
"Tags": Object {
368+
"SolutionId": Object {
369+
"Fn::FindInMap": Array [
370+
"Solution",
371+
"Config",
372+
"SolutionId",
373+
],
374+
},
375+
"Solutions:ApplicationType": "AWS-Solutions",
376+
"Solutions:SolutionID": Object {
377+
"Fn::FindInMap": Array [
378+
"Solution",
379+
"Config",
380+
"SolutionId",
381+
],
382+
},
383+
"Solutions:SolutionName": "Distributed Load Testing",
384+
"Solutions:SolutionVersion": Object {
385+
"Fn::FindInMap": Array [
386+
"Solution",
387+
"Config",
388+
"CodeVersion",
389+
],
390+
},
391+
},
392+
},
393+
"Type": "AWS::ServiceCatalogAppRegistry::Application",
394+
},
395+
"AppRegistryAttributeGroupAssociation52da5400282951AFD8BB": Object {
396+
"Properties": Object {
397+
"Application": Object {
398+
"Fn::GetAtt": Array [
399+
"AppRegistry968496A3",
400+
"Id",
401+
],
402+
},
403+
"AttributeGroup": Object {
404+
"Fn::GetAtt": Array [
405+
"DefaultApplicationAttributesFC1CC26B",
406+
"Id",
407+
],
408+
},
409+
},
410+
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation",
411+
},
412+
"AppRegistryResourceAssociation08d5313bf5c779236CB6": Object {
413+
"Properties": Object {
414+
"Application": Object {
415+
"Fn::GetAtt": Array [
416+
"AppRegistry968496A3",
417+
"Id",
418+
],
419+
},
420+
"Resource": Object {
421+
"Ref": "AWS::StackId",
422+
},
423+
"ResourceType": "CFN_STACK",
424+
},
425+
"Type": "AWS::ServiceCatalogAppRegistry::ResourceAssociation",
426+
},
350427
"DLTApi0C903EB5": Object {
351428
"Properties": Object {
352429
"Description": Object {
@@ -2251,6 +2328,10 @@ Object {
22512328
"id": "W35",
22522329
"reason": "This is the logging bucket, it does not require logging.",
22532330
},
2331+
Object {
2332+
"id": "W51",
2333+
"reason": "Since the bucket does not allow the public access, it does not require to have bucket policy.",
2334+
},
22542335
],
22552336
},
22562337
},
@@ -5410,6 +5491,42 @@ Object {
54105491
},
54115492
"Type": "AWS::EC2::Subnet",
54125493
},
5494+
"DefaultApplicationAttributesFC1CC26B": Object {
5495+
"Properties": Object {
5496+
"Attributes": Object {
5497+
"applicationType": "AWS-Solutions",
5498+
"solutionID": Object {
5499+
"Fn::FindInMap": Array [
5500+
"Solution",
5501+
"Config",
5502+
"SolutionId",
5503+
],
5504+
},
5505+
"solutionName": "Distributed Load Testing",
5506+
"version": Object {
5507+
"Fn::FindInMap": Array [
5508+
"Solution",
5509+
"Config",
5510+
"CodeVersion",
5511+
],
5512+
},
5513+
},
5514+
"Description": "Attribute group for solution information",
5515+
"Name": Object {
5516+
"Ref": "AWS::StackName",
5517+
},
5518+
"Tags": Object {
5519+
"SolutionId": Object {
5520+
"Fn::FindInMap": Array [
5521+
"Solution",
5522+
"Config",
5523+
"SolutionId",
5524+
],
5525+
},
5526+
},
5527+
},
5528+
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroup",
5529+
},
54135530
"RealTimeDataRealTimeDataPublisher7E8F8F6C": Object {
54145531
"DependsOn": Array [
54155532
"RealTimeDatarealTimeDataPublisherRoleA8976D01",

source/infrastructure/test/common-resources.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ test('DLT API Test', () => {
1616
expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
1717
expect(common.s3LogsBucket).toBeDefined();
1818
expect(common.sourceBucket).toBeDefined();
19+
expect(common.appRegistryApplication).toBeDefined();
1920
});

0 commit comments

Comments
 (0)