Skip to content

Commit

Permalink
Updates for v4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eggoynes committed Nov 9, 2022
1 parent 0dcc31f commit 8065b92
Show file tree
Hide file tree
Showing 12 changed files with 693 additions and 464 deletions.
52 changes: 27 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,45 @@ 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).

## [4.1.0] - 2022-11-9

### New
- Added Service Catalog AppRegistry Application resource
- Added Application Insights within the AppRegistry dashboard

### Changed
- Added stack name to CachePolicy to make unique name allowing for multiple concurrent stacks
- Added stack name to AppRegistry application name to allow for multiple concurrent stacks

## [4.0.1] - 2022-8-3

### New
```
# Added Service Catalog AppRegistry Application resource
```
- Added Service Catalog AppRegistry Application resource

### Changed
```
# Disabled versioning on buckets within the CloudFront to S3 construct
```
- Disabled versioning on buckets within the CloudFront to S3 construct

## [4.0.0] - 2022-7-6

### New
```
# Added cdk infrastructure in source/constructs directory
# Defined resources for cdk stack in source/constructs/lib/live-streaming.ts
# Added links to MediaLive and S3 consoles to CloudFormation Outputs
# Added links to metric dashboards for MediaLive and MediaPackage to CloudFormation Outputs
# Added SonarQube properties file: sonar-project.properties
# Added snapshot test to source/constructs/test directory
# Added cdk nag rule suppressions
- Added cdk infrastructure in source/constructs directory
- Defined resources for cdk stack in source/constructs/lib/live-streaming.ts
- Added links to MediaLive and S3 consoles to CloudFormation Outputs
- Added links to metric dashboards for MediaLive and MediaPackage to CloudFormation Outputs
- Added SonarQube properties file: sonar-project.properties
- Added snapshot test to source/constructs/test directory
- Added cdk nag rule suppressions
# Added SolutionId tag to resources
```

### Changed
```
# Removed CloudFormation template live-streaming-on-aws.yaml
# Use CachePolicy instead of ForwardedValues(deprecated) for cloudfront distribution
# Use @aws-solutions-constructs/aws-cloudfront-s3 construct to deploy demo resources
# Updated deployment/run-unit-tests.sh to generate unit test coverage reports
# Updated deployment/build-s3-dist.sh to output cdk nag errors
# Updated source/custom-resource/lib/medialive/index.spec.js to increase unit test coverage
# Generate secret string for Cdn Secret resource using cdk instead of hard coding
# Upgrade path from old versions require a delete and re-deploy since moving to CDK
```
- Removed CloudFormation template live-streaming-on-aws.yaml
- Use CachePolicy instead of ForwardedValues(deprecated) for cloudfront distribution
- Use @aws-solutions-constructs/aws-cloudfront-s3 construct to deploy demo resources
- Updated deployment/run-unit-tests.sh to generate unit test coverage reports
- Updated deployment/build-s3-dist.sh to output cdk nag errors
- Updated source/custom-resource/lib/medialive/index.spec.js to increase unit test coverage
- Generate secret string for Cdn Secret resource using cdk instead of hard coding
- Upgrade path from old versions require a delete and re-deploy since moving to CDK

### Contributors
* @sandimciin
Expand Down
20 changes: 20 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ THIRD PARTY COMPONENTS
This software includes third party software subject to the following copyrights:

AWS SDK under the Apache License Version 2.0
AWS CDK under the Apache License Version 2.0
requests under the Apache License Version 2.0
Stanford Javascript Crypto Library under the BSD license or under the GNU GPL, version 2.0
uuid.js under the Massachusetts Institute of Technology (MIT) license
Expand All @@ -34,5 +35,24 @@ react-bootstrap under the Massachusetts Institute of Technology (MIT) license
react-dom under the Massachusetts Institute of Technology (MIT) license
react-scripts under the Massachusetts Institute of Technology (MIT) license
react-player under the Massachusetts Institute of Technology (MIT) license
json-to-pretty-yaml under the Apache License Version 2.0
@aws-cdk/aws-cloudwatch under the Apache License Version 2.0
@aws-cdk/aws-lambda under the Apache License Version 2.0
@aws-cdk/aws-medialive under the Apache License Version 2.0
@aws-cdk/aws-s3 under the Apache License Version 2.0
@aws-cdk/aws-servicecatalogappregistry under the Apache License Version 2.0
@aws-cdk/aws-applicationinsights under the Apache License Version 2.0
@aws-cdk/core under the Apache License Version 2.0
@aws-solutions-constructs/aws-cloudfront-s3 under the Apache License Version 2.0
cdk-nag under the Apache License Version 2.0
source-map-support under the Massachusetts Institute of Technology (MIT) license
@aws-cdk/assert under the Apache License Version 2.0
@types/jest under the Massachusetts Institute of Technology (MIT) license
@types/node under the Massachusetts Institute of Technology (MIT) license
aws-cdk under the Apache License Version 2.0
jest under the Massachusetts Institute of Technology (MIT) license
ts-jest under the Massachusetts Institute of Technology (MIT) license
ts-node under the Massachusetts Institute of Technology (MIT) license
typescript under the Apache License Version 2.0

The licenses for these third party components are included in LICENSE.txt
124 changes: 73 additions & 51 deletions source/console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 43 additions & 8 deletions source/constructs/lib/live-streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Secret } from '@aws-cdk/aws-secretsmanager';
import * as cloudfront from '@aws-cdk/aws-cloudfront';
import * as origin from '@aws-cdk/aws-cloudfront-origins';
import * as appreg from '@aws-cdk/aws-servicecatalogappregistry';
import * as applicationinsights from '@aws-cdk/aws-applicationinsights';
import { CloudFrontToS3 } from '@aws-solutions-constructs/aws-cloudfront-s3';
import { NagSuppressions } from 'cdk-nag';

Expand Down Expand Up @@ -619,7 +620,11 @@ export class LiveStreaming extends cdk.Stack {
/**
* CloudFront Distribution
*/
const cachePolicy = new cloudfront.CachePolicy(this, 'CachePolicy', {
// Need Unique name for each Cache Policy.
const cachePolicyName = `CachePolicy-${cdk.Aws.STACK_NAME}`;

const cachePolicy = new cloudfront.CachePolicy(this, `CachePolicy`, {
cachePolicyName: cachePolicyName,
cookieBehavior: cloudfront.CacheCookieBehavior.all(),
headerBehavior: cloudfront.CacheHeaderBehavior.allowList(
'Access-Control-Allow-Origin',
Expand Down Expand Up @@ -883,12 +888,42 @@ export class LiveStreaming extends cdk.Stack {
/**
* AppRegistry
*/
const appRegistry = new appreg.Application(this, 'AppRegistryApp', {
applicationName: 'LiveStreamingOnAws',
description: '(SO0013) Live Streaming on AWS Solution %%VERSION%%'
});
appRegistry.associateStack(this);

const solutionId = 'SO0013';
const solutionName = 'Live Streaming on AWS';
const applicationName = `live-streaming-on-aws-${cdk.Aws.STACK_NAME}`;
const attributeGroup = new appreg.AttributeGroup(this, 'AppRegistryAttributeGroup', {
attributeGroupName: cdk.Aws.STACK_NAME,
description: "Attribute group for solution information.",
attributes: {
ApplicationType: 'AWS-Solutions',
SolutionVersion: '%%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('appRegistryApplicationName', 'live-streaming-on-aws-stack');
cdk.Tags.of(appRegistry).add('ApplicationType', 'AWS-Solutions');

appRegistry.node.addDependency(attributeGroup);
appRegistry.associateAttributeGroup(attributeGroup);

const appInsights = new applicationinsights.CfnApplication(this, 'ApplicationInsightsApp', {
resourceGroupName: `AWS_AppRegistry_Application-${applicationName}`,
autoConfigurationEnabled: true,
cweMonitorEnabled: true,
opsCenterEnabled: true
});
appInsights.node.addDependency(appRegistry);


/**
* AnonymousMetric
Expand Down Expand Up @@ -992,7 +1027,7 @@ export class LiveStreaming extends cdk.Stack {
value: `https://${cdk.Aws.REGION}.console.aws.amazon.com/servicecatalog/home?#applications/${appRegistry.applicationId}`,
exportName: `${cdk.Aws.STACK_NAME}-AppRegistry`
});
new cdk.CfnOutput(this, 'MediaLiveChannelId', {
new cdk.CfnOutput(this, 'MediaLiveChannelId', { // NOSONAR
description: 'MediaLive Channel Id',
value: `${mediaLiveChannel.getAttString('ChannelId')}`,
exportName: `${cdk.Aws.STACK_NAME}-MediaLiveChannelId`
Expand Down
3 changes: 2 additions & 1 deletion source/constructs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "jest --coverage",
"test": "jest --coverage --updateSnapshot",
"cdk": "cdk"
},
"devDependencies": {
Expand All @@ -34,6 +34,7 @@
"@aws-cdk/aws-mediapackage": "1.126.0",
"@aws-cdk/aws-s3": "1.126.0",
"@aws-cdk/aws-servicecatalogappregistry": "1.126.0",
"@aws-cdk/aws-applicationinsights": "1.126.0",
"@aws-cdk/core": "1.126.0",
"@aws-solutions-constructs/aws-cloudfront-s3": "1.126.0",
"cdk-nag": "^1.0.0",
Expand Down
Loading

0 comments on commit 8065b92

Please sign in to comment.