Skip to content

Commit

Permalink
Merge pull request #938 from awslabs/bump/2.36.0
Browse files Browse the repository at this point in the history
chore(release): 2.36.0
  • Loading branch information
biffgaut authored Mar 29, 2023
2 parents b4bbe63 + 5ee518c commit d511202
Show file tree
Hide file tree
Showing 155 changed files with 2,159 additions and 1,723 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.36.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.35.0...v2.36.0) (2023-03-29)

Built on CDK v2.71.0

## [2.35.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.34.0...v2.35.0) (2023-03-23)

Built on CDK v2.68.0
Expand Down
4 changes: 1 addition & 3 deletions deployment/v2/align-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ const findVersion = process.argv[2];
const replaceVersion = process.argv[3];

// these versions need to be sourced from a config file
const awsCdkLibVersion = '2.68.0';
const awsCdkLibVersion = '2.71.0';
const constructsVersion = '10.0.0';
const MODULE_EXEMPTIONS = new Set([
'@aws-cdk/cloudformation-diff',
'@aws-cdk/assert',
'@aws-cdk/assert/jest',
'aws-cdk'
]);

Expand Down
2 changes: 1 addition & 1 deletion source/lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"./patterns/@aws-solutions-constructs/*"
],
"rejectCycles": "true",
"version": "2.35.0"
"version": "2.36.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"constructs": "^3.2.0"
},
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-ec2": "0.0.0",
"@aws-cdk/aws-ecs": "0.0.0",
"@aws-cdk/aws-ecr": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
*/

import { AlbToFargate, AlbToFargateProps } from "../lib";
// import * as ecs from '@aws-cdk/aws-ecs';
import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2';
import * as cdk from "aws-cdk-lib";
import '@aws-cdk/assert/jest';
import * as defaults from '@aws-solutions-constructs/core';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import { Template } from "aws-cdk-lib/assertions";

test('Test new vpc, load balancer, service', () => {
// An environment with region is required to enable logging on an ALB
Expand All @@ -34,16 +33,17 @@ test('Test new vpc, load balancer, service', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).not.toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
defaults.expectNonexistence(stack, 'AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS'
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: '10.0.0.0/16',
});
Expand All @@ -64,17 +64,18 @@ test('Test new load balancer, service, existing vpc', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: '172.168.0.0/16'
});
expect(stack).toCountResources('AWS::EC2::VPC', 1);
template.resourceCountIs('AWS::EC2::VPC', 1);
});

test('Test new service, existing load balancer, vpc', () => {
Expand Down Expand Up @@ -103,23 +104,24 @@ test('Test new service, existing load balancer, vpc', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toCountResources('AWS::ECS::Service', 1);
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.resourceCountIs('AWS::ECS::Service', 1);
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::Listener', 1);
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', {
template.resourceCountIs('AWS::ElasticLoadBalancingV2::Listener', 1);
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::LoadBalancer', {
Name: testName
});
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::LoadBalancer', 1);
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.resourceCountIs('AWS::ElasticLoadBalancingV2::LoadBalancer', 1);
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: '172.168.0.0/16'
});
expect(stack).toCountResources('AWS::EC2::VPC', 1);
template.resourceCountIs('AWS::EC2::VPC', 1);
});

test('Test existing load balancer, vpc, service', () => {
Expand Down Expand Up @@ -155,23 +157,24 @@ test('Test existing load balancer, vpc, service', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toCountResources('AWS::ECS::Service', 1);
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.resourceCountIs('AWS::ECS::Service', 1);
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::Listener', 1);
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', {
template.resourceCountIs('AWS::ElasticLoadBalancingV2::Listener', 1);
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::LoadBalancer', {
Name: testName
});
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::LoadBalancer', 1);
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.resourceCountIs('AWS::ElasticLoadBalancingV2::LoadBalancer', 1);
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: '172.168.0.0/16'
});
expect(stack).toCountResources('AWS::EC2::VPC', 1);
template.resourceCountIs('AWS::EC2::VPC', 1);
});

test('Test add a second target with rules', () => {
Expand Down Expand Up @@ -203,15 +206,16 @@ test('Test add a second target with rules', () => {

new AlbToFargate(stack, 'test-two-construct', testPropsTwo);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::TargetGroup', 2);
expect(stack).toCountResources('AWS::ElasticLoadBalancingV2::ListenerRule', 1);
expect(stack).toHaveResourceLike('AWS::ElasticLoadBalancingV2::ListenerRule', {
template.resourceCountIs('AWS::ElasticLoadBalancingV2::TargetGroup', 2);
template.resourceCountIs('AWS::ElasticLoadBalancingV2::ListenerRule', 1);
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::ListenerRule', {
Conditions: [
{
Field: "path-pattern",
Expand All @@ -223,11 +227,11 @@ test('Test add a second target with rules', () => {
}
],
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: '172.168.0.0/16'
});
expect(stack).toCountResources('AWS::EC2::VPC', 1);
template.resourceCountIs('AWS::EC2::VPC', 1);
});

test('Test new vpc, load balancer, service - custom Service Props', () => {
Expand All @@ -249,17 +253,18 @@ test('Test new vpc, load balancer, service - custom Service Props', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE',
ServiceName: serviceName,
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).not.toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
defaults.expectNonexistence(stack, 'AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS'
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true
});
});
Expand All @@ -281,16 +286,17 @@ test('Test new vpc, load balancer, service - custom VPC Props', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE',
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).not.toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
defaults.expectNonexistence(stack, 'AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS'
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
CidrBlock: testCidr,
});
Expand Down Expand Up @@ -319,22 +325,23 @@ test('Test new vpc, load balancer, service - custom LoadBalancer and targetGroup

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE',
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP'
});
expect(stack).not.toHaveResource('AWS::ElasticLoadBalancingV2::Listener', {
defaults.expectNonexistence(stack, 'AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS'
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::LoadBalancer', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::LoadBalancer', {
Name: testLoadBalancerName
});
expect(stack).toHaveResource('AWS::ElasticLoadBalancingV2::TargetGroup', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::TargetGroup', {
Name: testTargetGroupName
});
});
Expand All @@ -356,10 +363,11 @@ test('Test HTTPS API with new vpc, load balancer, service', () => {

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toHaveResourceLike('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP',
DefaultActions: [
{
Expand All @@ -372,11 +380,11 @@ test('Test HTTPS API with new vpc, load balancer, service', () => {
}
],
});
expect(stack).toHaveResourceLike('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS',
Port: 443,
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true
});
});
Expand All @@ -398,10 +406,11 @@ test('Test HTTPS API with new vpc, load balancer, service and private API', () =

new AlbToFargate(stack, 'test-construct', testProps);

expect(stack).toHaveResourceLike("AWS::ECS::Service", {
const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::ECS::Service", {
LaunchType: 'FARGATE'
});
expect(stack).toHaveResourceLike('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTP',
DefaultActions: [
{
Expand All @@ -414,15 +423,15 @@ test('Test HTTPS API with new vpc, load balancer, service and private API', () =
}
],
});
expect(stack).toHaveResourceLike('AWS::ElasticLoadBalancingV2::Listener', {
template.hasResourceProperties('AWS::ElasticLoadBalancingV2::Listener', {
Protocol: 'HTTPS',
Port: 443,
});
expect(stack).toHaveResource('AWS::EC2::VPC', {
template.hasResourceProperties('AWS::EC2::VPC', {
EnableDnsHostnames: true,
});
expect(stack).toCountResources("AWS::EC2::Subnet", 3);
expect(stack).toHaveResource("AWS::EC2::Subnet", {
template.resourceCountIs("AWS::EC2::Subnet", 3);
template.hasResourceProperties("AWS::EC2::Subnet", {
Tags: [
{
Key: "aws-cdk:subnet-name",
Expand All @@ -438,7 +447,7 @@ test('Test HTTPS API with new vpc, load balancer, service and private API', () =
}
]
});
expect(stack).not.toHaveResource("AWS::EC2::Subnet", {
defaults.expectNonexistence(stack, "AWS::EC2::Subnet", {
Tags: [
{
Key: "aws-cdk:subnet-name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"constructs": "^3.2.0"
},
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@aws-cdk/aws-ec2": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/aws-elasticloadbalancingv2": "0.0.0",
Expand Down
Loading

0 comments on commit d511202

Please sign in to comment.