Skip to content

Commit

Permalink
Update to version v6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eggoynes committed Feb 28, 2023
1 parent 23815bb commit 022196e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 29 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.1.0] - 2023-3-30
### Changed
- Added region name and account ID to AppRegistry Application name
- Changed AppRegistry Attribute Group name to Region-StackName
- Updated AppRegistry attribute and tag names

## [6.0.0] - 2022-10-17
### Added
- Added cdk infrastructure in source/cdk directory
Expand Down
2 changes: 1 addition & 1 deletion deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ for d in `find . -mindepth 1 -maxdepth 1 -type d`; do
# Zip artifacts from asset folder
cd $fname
rm -rf node_modules/
rm -rf coverage/
#rm -rf coverage/
if [ -f "package.json" ]
then
npm install --production
Expand Down
2 changes: 1 addition & 1 deletion source/cdk/bin/vod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ new VideoOnDemand(app, 'VideoOnDemand', { // NOSONAR
}); // NOSONAR

//cdk nag
cdk.Aspects.of(app).add(new AwsSolutionsChecks({ verbose: true }));
cdk.Aspects.of(app).add(new AwsSolutionsChecks({ verbose: true }));
24 changes: 11 additions & 13 deletions source/cdk/lib/vod-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
import * as events from 'aws-cdk-lib/aws-events';
import * as targets from 'aws-cdk-lib/aws-events-targets';
import * as appreg from '@aws-cdk/aws-servicecatalogappregistry-alpha';
import * as appinsights from 'aws-cdk-lib/aws-applicationinsights';
import { CloudFrontToS3 } from '@aws-solutions-constructs/aws-cloudfront-s3';
import { NagSuppressions } from 'cdk-nag';

Expand Down Expand Up @@ -2296,27 +2295,26 @@ export class VideoOnDemand extends cdk.Stack {
/**
* AppRegistry
*/
const applicationName = `video-on-demand-on-aws-${cdk.Aws.STACK_NAME}`;
const applicationName = `video-on-demand-on-aws-${cdk.Aws.REGION}-${cdk.Aws.ACCOUNT_ID}-${cdk.Aws.STACK_NAME}`;
const attributeGroup = new appreg.AttributeGroup(this, 'AppRegistryAttributeGroup', {
attributeGroupName: cdk.Aws.STACK_NAME,
attributeGroupName: `${cdk.Aws.REGION}-${cdk.Aws.STACK_NAME}`,
description: 'Attribute group for solution information',
attributes: {
ApplicationType: 'AWS-Solutions',
SolutionVersion: '%%VERSION%%',
SolutionID: solutionId,
SolutionName: solutionName
applicationType: 'AWS-Solutions',
version: '%%VERSION%%',
solutionID: solutionId,
solutionName: solutionName
}
});
const appRegistry = new appreg.Application(this, 'AppRegistryApp', {
applicationName: applicationName,
description: `Service Catalog application to track and manage all your resources. The SolutionId is ${solutionId} and SolutionVersion is %%VERSION%%.`
});
appRegistry.associateStack(this);
cdk.Tags.of(appRegistry).add('solutionId', solutionId);
cdk.Tags.of(appRegistry).add('SolutionName', solutionName);
cdk.Tags.of(appRegistry).add('SolutionDomain', 'CloudFoundations');
cdk.Tags.of(appRegistry).add('SolutionVersion', '%%VERSION%%');
cdk.Tags.of(appRegistry).add('ApplicationType', 'AWS-Solutions');
appRegistry.associateApplicationWithStack(this);
cdk.Tags.of(appRegistry).add('Solutions:SolutionID', solutionId);
cdk.Tags.of(appRegistry).add('Solutions:SolutionName', solutionName);
cdk.Tags.of(appRegistry).add('Solutions:SolutionVersion', '%%VERSION%%');
cdk.Tags.of(appRegistry).add('Solutions:ApplicationType', 'AWS-Solutions');

appRegistry.node.addDependency(attributeGroup);
appRegistry.associateAttributeGroup(attributeGroup);
Expand Down
43 changes: 29 additions & 14 deletions source/cdk/test/__snapshots__/vod.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,26 @@ exports[`VideoOnDemand Stack Test 1`] = `
,
[
video-on-demand-on-aws-,
{
Ref: AWS::Region,
},
-,
{
Ref: AWS::AccountId,
},
-,
{
Ref: AWS::StackName,
},
],
],
},
Tags: {
ApplicationType: AWS-Solutions,
SolutionDomain: CloudFoundations,
SolutionId: SO0021,
SolutionName: Video on Demand on AWS,
SolutionVersion: %%VERSION%%,
solutionId: SO0021,
Solutions:ApplicationType: AWS-Solutions,
Solutions:SolutionID: SO0021,
Solutions:SolutionName: Video on Demand on AWS,
Solutions:SolutionVersion: %%VERSION%%,
},
},
Type: AWS::ServiceCatalogAppRegistry::Application,
Expand All @@ -461,10 +468,7 @@ exports[`VideoOnDemand Stack Test 1`] = `
},
Type: AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation,
},
AppRegistryAppResourceAssociationa70e26ed0b0e5F5D9D9F: {
DependsOn: [
AppRegistryAttributeGroup7AF07446,
],
AppRegistryAssociation: {
Properties: {
Application: {
Fn::GetAtt: [
Expand All @@ -482,14 +486,25 @@ exports[`VideoOnDemand Stack Test 1`] = `
AppRegistryAttributeGroup7AF07446: {
Properties: {
Attributes: {
ApplicationType: AWS-Solutions,
SolutionID: SO0021,
SolutionName: Video on Demand on AWS,
SolutionVersion: %%VERSION%%,
applicationType: AWS-Solutions,
solutionID: SO0021,
solutionName: Video on Demand on AWS,
version: %%VERSION%%,
},
Description: Attribute group for solution information,
Name: {
Ref: AWS::StackName,
Fn::Join: [
,
[
{
Ref: AWS::Region,
},
-,
{
Ref: AWS::StackName,
},
],
],
},
Tags: {
SolutionId: SO0021,
Expand Down

0 comments on commit 022196e

Please sign in to comment.