From ab7906000b0e6656e392c2c48d0c548a44cb6191 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Mon, 11 Sep 2023 16:58:55 -0400 Subject: [PATCH 1/3] Added code for deploing a ALB with the UI code --- cdk-outputs.json | 5 + cdk.context.json | 98 +++ cdk.json | 4 + cdk.out/cdk-stack.assets.json | 20 + cdk.out/cdk-stack.template.json | 1097 +++++++++++++++++++++++++ cdk.out/cdk.out | 1 + cdk.out/manifest.json | 106 +++ cdk.out/stage-alb-stack.assets.json | 20 + cdk.out/stage-alb-stack.template.json | 186 +++++ cdk.out/tree.json | 398 +++++++++ cdk/cdk-stage.ts | 13 + cdk/stage-alb-stack.ts | 54 ++ package.json | 5 + tsconfig.json | 32 + 14 files changed, 2039 insertions(+) create mode 100644 cdk-outputs.json create mode 100644 cdk.context.json create mode 100644 cdk.json create mode 100644 cdk.out/cdk-stack.assets.json create mode 100644 cdk.out/cdk-stack.template.json create mode 100644 cdk.out/cdk.out create mode 100644 cdk.out/manifest.json create mode 100644 cdk.out/stage-alb-stack.assets.json create mode 100644 cdk.out/stage-alb-stack.template.json create mode 100644 cdk.out/tree.json create mode 100644 cdk/cdk-stage.ts create mode 100644 cdk/stage-alb-stack.ts create mode 100644 tsconfig.json diff --git a/cdk-outputs.json b/cdk-outputs.json new file mode 100644 index 000000000..8278425ae --- /dev/null +++ b/cdk-outputs.json @@ -0,0 +1,5 @@ +{ + "stage-alb-stack": { + "albDNS": "internal-stage-alb8A-D8N9BHZDT6F2-1821793229.us-east-1.elb.amazonaws.com" + } +} diff --git a/cdk.context.json b/cdk.context.json new file mode 100644 index 000000000..6e5c33c0e --- /dev/null +++ b/cdk.context.json @@ -0,0 +1,98 @@ +{ + "availability-zones:account=100225593120:region=us-east-1": [ + "us-east-1a", + "us-east-1b", + "us-east-1c", + "us-east-1d", + "us-east-1e", + "us-east-1f" + ], + "vpc-provider:account=100225593120:filter.tag:Name=Docker:region=us-east-1:returnAsymmetricSubnets=true": { + "vpcId": "vpc-55522232", + "vpcCidrBlock": "172.31.0.0/16", + "ownerAccountId": "100225593120", + "availabilityZones": [], + "subnetGroups": [ + { + "name": "Public", + "type": "Public", + "subnets": [ + { + "subnetId": "subnet-3ebf4477", + "cidr": "172.31.0.0/20", + "availabilityZone": "us-east-1a", + "routeTableId": "rtb-c63af6a0" + }, + { + "subnetId": "subnet-df7c7487", + "cidr": "172.31.16.0/20", + "availabilityZone": "us-east-1b", + "routeTableId": "rtb-c63af6a0" + }, + { + "subnetId": "subnet-81c95ee4", + "cidr": "172.31.64.0/20", + "availabilityZone": "us-east-1c", + "routeTableId": "rtb-c63af6a0" + }, + { + "subnetId": "subnet-ff838bd5", + "cidr": "172.31.48.0/20", + "availabilityZone": "us-east-1d", + "routeTableId": "rtb-c63af6a0" + }, + { + "subnetId": "subnet-af62dca3", + "cidr": "172.31.80.0/20", + "availabilityZone": "us-east-1f", + "routeTableId": "rtb-c63af6a0" + } + ] + }, + { + "name": "Private", + "type": "Private", + "subnets": [ + { + "subnetId": "subnet-0d4703177afb1797d", + "cidr": "172.31.96.0/24", + "availabilityZone": "us-east-1a", + "routeTableId": "rtb-05e12b551f60b37ed" + }, + { + "subnetId": "subnet-04262fc338f638054", + "cidr": "172.31.97.0/24", + "availabilityZone": "us-east-1b", + "routeTableId": "rtb-05e12b551f60b37ed" + }, + { + "subnetId": "subnet-044457c061edf85f2", + "cidr": "172.31.98.0/24", + "availabilityZone": "us-east-1c", + "routeTableId": "rtb-05e12b551f60b37ed" + }, + { + "subnetId": "subnet-04019d42d5c9e6fb9", + "cidr": "172.31.99.0/24", + "availabilityZone": "us-east-1d", + "routeTableId": "rtb-05e12b551f60b37ed" + }, + { + "subnetId": "subnet-049778993fb504a7c", + "cidr": "172.31.101.0/24", + "availabilityZone": "us-east-1f", + "routeTableId": "rtb-05e12b551f60b37ed" + } + ] + } + ] + }, + "security-group:account=100225593120:region=us-east-1:securityGroupName=default:vpcId=vpc-55522232": { + "securityGroupId": "sg-21ac675b", + "allowAllOutbound": false + }, + "security-group:account=100225593120:region=us-east-1:securityGroupId=sg-21ac675b": { + "securityGroupId": "sg-21ac675b", + "allowAllOutbound": false + } +} diff --git a/cdk.json b/cdk.json new file mode 100644 index 000000000..f0c49fded --- /dev/null +++ b/cdk.json @@ -0,0 +1,4 @@ +{ + "app": "npx ts-node --prefer-ts-exts cdk/cdk-stage.ts", + "context": {} +} diff --git a/cdk.out/cdk-stack.assets.json b/cdk.out/cdk-stack.assets.json new file mode 100644 index 000000000..3c6354600 --- /dev/null +++ b/cdk.out/cdk-stack.assets.json @@ -0,0 +1,20 @@ +{ + "version": "34.0.0", + "files": { + "a4518594ba7b9be03de79203ec8a1006b42513fd59d1dc48d55538a9f27e9c4a": { + "source": { + "path": "cdk-stack.template.json", + "packaging": "file" + }, + "destinations": { + "100225593120-us-east-1": { + "bucketName": "cdk-hnb659fds-assets-100225593120-us-east-1", + "objectKey": "a4518594ba7b9be03de79203ec8a1006b42513fd59d1dc48d55538a9f27e9c4a.json", + "region": "us-east-1", + "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-file-publishing-role-100225593120-us-east-1" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/cdk.out/cdk-stack.template.json b/cdk.out/cdk-stack.template.json new file mode 100644 index 000000000..7d2dde57f --- /dev/null +++ b/cdk.out/cdk-stack.template.json @@ -0,0 +1,1097 @@ +{ + "Resources": { + "vpc555222327AFC16C5": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/Resource" + } + }, + "vpc55522232PublicSubnet1Subnet8C1D3F0B": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1a", + "CidrBlock": "10.0.0.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/Subnet" + } + }, + "vpc55522232PublicSubnet1RouteTable201E0132": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/RouteTable" + } + }, + "vpc55522232PublicSubnet1RouteTableAssociationFC3053F6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet1RouteTable201E0132" + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet1Subnet8C1D3F0B" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/RouteTableAssociation" + } + }, + "vpc55522232PublicSubnet1DefaultRoute3576EEAF": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpc55522232IGW2124CFCD" + }, + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet1RouteTable201E0132" + } + }, + "DependsOn": [ + "vpc55522232VPCGW0E59A086" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/DefaultRoute" + } + }, + "vpc55522232PublicSubnet1EIP2B529517": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet1" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/EIP" + } + }, + "vpc55522232PublicSubnet1NATGateway8F921A30": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpc55522232PublicSubnet1EIP2B529517", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet1Subnet8C1D3F0B" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "vpc55522232PublicSubnet1DefaultRoute3576EEAF", + "vpc55522232PublicSubnet1RouteTableAssociationFC3053F6" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/NATGateway" + } + }, + "vpc55522232PublicSubnet2Subnet82DD7CE0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1b", + "CidrBlock": "10.0.32.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/Subnet" + } + }, + "vpc55522232PublicSubnet2RouteTableB74BC90B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/RouteTable" + } + }, + "vpc55522232PublicSubnet2RouteTableAssociation94475C00": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet2RouteTableB74BC90B" + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet2Subnet82DD7CE0" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/RouteTableAssociation" + } + }, + "vpc55522232PublicSubnet2DefaultRoute96F97D0D": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpc55522232IGW2124CFCD" + }, + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet2RouteTableB74BC90B" + } + }, + "DependsOn": [ + "vpc55522232VPCGW0E59A086" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/DefaultRoute" + } + }, + "vpc55522232PublicSubnet2EIP9D615FD5": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet2" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/EIP" + } + }, + "vpc55522232PublicSubnet2NATGatewayCE45ECF6": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpc55522232PublicSubnet2EIP9D615FD5", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet2Subnet82DD7CE0" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "vpc55522232PublicSubnet2DefaultRoute96F97D0D", + "vpc55522232PublicSubnet2RouteTableAssociation94475C00" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/NATGateway" + } + }, + "vpc55522232PublicSubnet3SubnetB60D3678": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1c", + "CidrBlock": "10.0.64.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet3" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/Subnet" + } + }, + "vpc55522232PublicSubnet3RouteTableE4B6F284": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet3" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/RouteTable" + } + }, + "vpc55522232PublicSubnet3RouteTableAssociationE9DD046D": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet3RouteTableE4B6F284" + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet3SubnetB60D3678" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/RouteTableAssociation" + } + }, + "vpc55522232PublicSubnet3DefaultRoute4A067F3E": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "vpc55522232IGW2124CFCD" + }, + "RouteTableId": { + "Ref": "vpc55522232PublicSubnet3RouteTableE4B6F284" + } + }, + "DependsOn": [ + "vpc55522232VPCGW0E59A086" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/DefaultRoute" + } + }, + "vpc55522232PublicSubnet3EIP60F7BABB": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet3" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/EIP" + } + }, + "vpc55522232PublicSubnet3NATGateway285C26A6": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "vpc55522232PublicSubnet3EIP60F7BABB", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "vpc55522232PublicSubnet3SubnetB60D3678" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PublicSubnet3" + } + ] + }, + "DependsOn": [ + "vpc55522232PublicSubnet3DefaultRoute4A067F3E", + "vpc55522232PublicSubnet3RouteTableAssociationE9DD046D" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/NATGateway" + } + }, + "vpc55522232PrivateSubnet1Subnet2E4DA426": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1a", + "CidrBlock": "10.0.96.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/Subnet" + } + }, + "vpc55522232PrivateSubnet1RouteTableC546D020": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/RouteTable" + } + }, + "vpc55522232PrivateSubnet1RouteTableAssociation98BDECFD": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet1RouteTableC546D020" + }, + "SubnetId": { + "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/RouteTableAssociation" + } + }, + "vpc55522232PrivateSubnet1DefaultRouteD15CA2D8": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpc55522232PublicSubnet1NATGateway8F921A30" + }, + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet1RouteTableC546D020" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/DefaultRoute" + } + }, + "vpc55522232PrivateSubnet2SubnetBF911E75": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1b", + "CidrBlock": "10.0.128.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/Subnet" + } + }, + "vpc55522232PrivateSubnet2RouteTableC23CB4A9": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/RouteTable" + } + }, + "vpc55522232PrivateSubnet2RouteTableAssociationE7D278B5": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet2RouteTableC23CB4A9" + }, + "SubnetId": { + "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/RouteTableAssociation" + } + }, + "vpc55522232PrivateSubnet2DefaultRoute306FAD64": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpc55522232PublicSubnet2NATGatewayCE45ECF6" + }, + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet2RouteTableC23CB4A9" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/DefaultRoute" + } + }, + "vpc55522232PrivateSubnet3SubnetC9D7ECC5": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": "us-east-1c", + "CidrBlock": "10.0.160.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet3" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/Subnet" + } + }, + "vpc55522232PrivateSubnet3RouteTable571A2BD8": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232/PrivateSubnet3" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/RouteTable" + } + }, + "vpc55522232PrivateSubnet3RouteTableAssociationF86DE320": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet3RouteTable571A2BD8" + }, + "SubnetId": { + "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/RouteTableAssociation" + } + }, + "vpc55522232PrivateSubnet3DefaultRoute23A9E99F": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "vpc55522232PublicSubnet3NATGateway285C26A6" + }, + "RouteTableId": { + "Ref": "vpc55522232PrivateSubnet3RouteTable571A2BD8" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/DefaultRoute" + } + }, + "vpc55522232IGW2124CFCD": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/vpc-55522232" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/IGW" + } + }, + "vpc55522232VPCGW0E59A086": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "vpc55522232IGW2124CFCD" + }, + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/vpc-55522232/VPCGW" + } + }, + "alb8A8B13C2": { + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "Properties": { + "LoadBalancerAttributes": [ + { + "Key": "deletion_protection.enabled", + "Value": "false" + } + ], + "Scheme": "internal", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "albSecurityGroup49866104", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" + }, + { + "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" + }, + { + "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" + } + ], + "Type": "application" + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/Resource" + } + }, + "albSecurityGroup49866104": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Automatically created Security Group for ELB cdkstackalb6DF91EA2", + "SecurityGroupIngress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow from anyone on port 80", + "FromPort": 80, + "IpProtocol": "tcp", + "ToPort": 80 + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/SecurityGroup/Resource" + } + }, + "albSecurityGrouptocdkstackasgInstanceSecurityGroup3E3F3E71809881611E": { + "Type": "AWS::EC2::SecurityGroupEgress", + "Properties": { + "Description": "Load balancer to target", + "DestinationSecurityGroupId": { + "Fn::GetAtt": [ + "asgInstanceSecurityGroup5CEB2975", + "GroupId" + ] + }, + "FromPort": 80, + "GroupId": { + "Fn::GetAtt": [ + "albSecurityGroup49866104", + "GroupId" + ] + }, + "IpProtocol": "tcp", + "ToPort": 80 + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/SecurityGroup/to cdkstackasgInstanceSecurityGroup3E3F3E71:80" + } + }, + "albListener3EA0B2EF": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "albListenerdefaulttargetGroup79BAE92B" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "alb8A8B13C2" + }, + "Port": 80, + "Protocol": "HTTP" + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/Listener/Resource" + } + }, + "albListenerdefaulttargetGroup79BAE92B": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "HealthCheckIntervalSeconds": 30, + "HealthCheckPath": "/", + "HealthyThresholdCount": 5, + "Port": 80, + "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "false" + } + ], + "TargetType": "instance", + "UnhealthyThresholdCount": 2, + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/Listener/default-targetGroup/Resource" + } + }, + "albListenerstaticRule4F017351": { + "Type": "AWS::ElasticLoadBalancingV2::ListenerRule", + "Properties": { + "Actions": [ + { + "FixedResponseConfig": { + "ContentType": "text/html", + "MessageBody": "

Static ALB Response

", + "StatusCode": "200" + }, + "Type": "fixed-response" + } + ], + "Conditions": [ + { + "Field": "path-pattern", + "PathPatternConfig": { + "Values": [ + "/static" + ] + } + } + ], + "ListenerArn": { + "Ref": "albListener3EA0B2EF" + }, + "Priority": 5 + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/alb/Listener/--staticRule/Resource" + } + }, + "asgInstanceSecurityGroup5CEB2975": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "cdk-stack/asg/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/asg" + } + ], + "VpcId": { + "Ref": "vpc555222327AFC16C5" + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/InstanceSecurityGroup/Resource" + } + }, + "asgInstanceSecurityGroupfromcdkstackalbSecurityGroup20A8C03080818D6412": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "Description": "Load balancer to target", + "FromPort": 80, + "GroupId": { + "Fn::GetAtt": [ + "asgInstanceSecurityGroup5CEB2975", + "GroupId" + ] + }, + "IpProtocol": "tcp", + "SourceSecurityGroupId": { + "Fn::GetAtt": [ + "albSecurityGroup49866104", + "GroupId" + ] + }, + "ToPort": 80 + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/InstanceSecurityGroup/from cdkstackalbSecurityGroup20A8C030:80" + } + }, + "asgInstanceRole8AC4201C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "cdk-stack/asg" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/InstanceRole/Resource" + } + }, + "asgInstanceProfile4E44E320": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "asgInstanceRole8AC4201C" + } + ] + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/InstanceProfile" + } + }, + "asgLaunchConfig37FDE42B": { + "Type": "AWS::AutoScaling::LaunchConfiguration", + "Properties": { + "IamInstanceProfile": { + "Ref": "asgInstanceProfile4E44E320" + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "asgInstanceSecurityGroup5CEB2975", + "GroupId" + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash\nsudo su\nyum install -y httpd\nsystemctl start httpd\nsystemctl enable httpd\necho \"

Hello World from $(hostname -f)

\" > /var/www/html/index.html" + } + }, + "DependsOn": [ + "asgInstanceRole8AC4201C" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/LaunchConfig" + } + }, + "asgASG4D014670": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchConfigurationName": { + "Ref": "asgLaunchConfig37FDE42B" + }, + "MaxSize": "3", + "MinSize": "2", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "cdk-stack/asg" + } + ], + "TargetGroupARNs": [ + { + "Ref": "albListenerdefaulttargetGroup79BAE92B" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" + }, + { + "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" + }, + { + "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/ASG" + } + }, + "asgScalingPolicyrequestsperminute5D73703F": { + "Type": "AWS::AutoScaling::ScalingPolicy", + "Properties": { + "AutoScalingGroupName": { + "Ref": "asgASG4D014670" + }, + "PolicyType": "TargetTrackingScaling", + "TargetTrackingConfiguration": { + "PredefinedMetricSpecification": { + "PredefinedMetricType": "ALBRequestCountPerTarget", + "ResourceLabel": { + "Fn::Join": [ + "", + [ + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Ref": "albListener3EA0B2EF" + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "albListener3EA0B2EF" + } + ] + } + ] + }, + "/", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "/", + { + "Ref": "albListener3EA0B2EF" + } + ] + } + ] + }, + "/", + { + "Fn::GetAtt": [ + "albListenerdefaulttargetGroup79BAE92B", + "TargetGroupFullName" + ] + } + ] + ] + } + }, + "TargetValue": 60 + } + }, + "DependsOn": [ + "albListenerstaticRule4F017351", + "albListenerdefaulttargetGroup79BAE92B", + "albListener3EA0B2EF" + ], + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/ScalingPolicyrequests-per-minute/Resource" + } + }, + "asgScalingPolicycpuutilscaling06365506": { + "Type": "AWS::AutoScaling::ScalingPolicy", + "Properties": { + "AutoScalingGroupName": { + "Ref": "asgASG4D014670" + }, + "PolicyType": "TargetTrackingScaling", + "TargetTrackingConfiguration": { + "PredefinedMetricSpecification": { + "PredefinedMetricType": "ASGAverageCPUUtilization" + }, + "TargetValue": 75 + } + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/asg/ScalingPolicycpu-util-scaling/Resource" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/31Sy27CMBD8Fu7GFbQ99EgRQpFQGyWIa7UxSzAkdmSvQSjKv9d5kSCqnnZndrQejz3nH+98NoGrnYr9eZrJhJcxgTgzT/2UKOa83BWCLQ9qFy5Z6JJMitglCqnmhi7SjnALSYYDP3ALa7WQQFKru7huVkFYly+gNRBe4cZCIy++HRYHitD4vhe0Tjq0IO/1mKMiFqNwRtJtbbQrGg//EqvUoLVPdKAavmKYgSUpMg37BDJQQqr04sNYFIVPoLnJxs8+mxmaetEDHuukJVSdpu9H8y2Y1N+vtzmGf2yJXBvxGFcMHGkrIPMuvUcP4hbct27AKXFcanWQqTP3l3iStqdvjf8CnutGofYumugfiIpJyHkZ6dZRXwNlqQ4hNPogvbmKRWi1M6KZhmAgR2rj+HZUuPb/dJKKKb1HfrIvl9kbn8/46+RkpZwap0jmyKO2/gL2/416uAIAAA==" + }, + "Metadata": { + "aws:cdk:path": "cdk-stack/CDKMetadata/Default" + } + } + }, + "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Outputs": { + "albDNS": { + "Value": { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/cdk.out/cdk.out b/cdk.out/cdk.out new file mode 100644 index 000000000..2313ab543 --- /dev/null +++ b/cdk.out/cdk.out @@ -0,0 +1 @@ +{"version":"34.0.0"} \ No newline at end of file diff --git a/cdk.out/manifest.json b/cdk.out/manifest.json new file mode 100644 index 000000000..7647b8e69 --- /dev/null +++ b/cdk.out/manifest.json @@ -0,0 +1,106 @@ +{ + "version": "34.0.0", + "artifacts": { + "stage-alb-stack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "stage-alb-stack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "stage-alb-stack": { + "type": "aws:cloudformation:stack", + "environment": "aws://100225593120/us-east-1", + "properties": { + "templateFile": "stage-alb-stack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-deploy-role-100225593120-us-east-1", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-cfn-exec-role-100225593120-us-east-1", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-100225593120-us-east-1/3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "stage-alb-stack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-lookup-role-100225593120-us-east-1", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "stage-alb-stack.assets" + ], + "metadata": { + "/stage-alb-stack/default/from 0.0.0.0_0:443": [ + { + "type": "aws:cdk:logicalId", + "data": "defaultfrom00000443FDCE37BB" + } + ], + "/stage-alb-stack/alb/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "alb8A8B13C2" + } + ], + "/stage-alb-stack/alb/HTTPS Listener/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "albHTTPSListener7C8C4C55" + } + ], + "/stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "albHTTPSListenerBackendStageGroup18A8DB5E" + } + ], + "/stage-alb-stack/Public DNS/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PublicDNSD41885E8" + } + ], + "/stage-alb-stack/Private DNS/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "PrivateDNSEACE6CB2" + } + ], + "/stage-alb-stack/albDNS": [ + { + "type": "aws:cdk:logicalId", + "data": "albDNS" + } + ], + "/stage-alb-stack/CDKMetadata/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "CDKMetadata" + } + ], + "/stage-alb-stack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/stage-alb-stack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "stage-alb-stack" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/cdk.out/stage-alb-stack.assets.json b/cdk.out/stage-alb-stack.assets.json new file mode 100644 index 000000000..62cd4b0d1 --- /dev/null +++ b/cdk.out/stage-alb-stack.assets.json @@ -0,0 +1,20 @@ +{ + "version": "34.0.0", + "files": { + "3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b": { + "source": { + "path": "stage-alb-stack.template.json", + "packaging": "file" + }, + "destinations": { + "100225593120-us-east-1": { + "bucketName": "cdk-hnb659fds-assets-100225593120-us-east-1", + "objectKey": "3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b.json", + "region": "us-east-1", + "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-file-publishing-role-100225593120-us-east-1" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/cdk.out/stage-alb-stack.template.json b/cdk.out/stage-alb-stack.template.json new file mode 100644 index 000000000..fb15d30e1 --- /dev/null +++ b/cdk.out/stage-alb-stack.template.json @@ -0,0 +1,186 @@ +{ + "Resources": { + "defaultfrom00000443FDCE37BB": { + "Type": "AWS::EC2::SecurityGroupIngress", + "Properties": { + "CidrIp": "0.0.0.0/0", + "Description": "Allow from anyone on port 443", + "FromPort": 443, + "GroupId": "sg-21ac675b", + "IpProtocol": "tcp", + "ToPort": 443 + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/default/from 0.0.0.0_0:443" + } + }, + "alb8A8B13C2": { + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "Properties": { + "LoadBalancerAttributes": [ + { + "Key": "deletion_protection.enabled", + "Value": "false" + } + ], + "Scheme": "internal", + "SecurityGroups": [ + "sg-21ac675b" + ], + "Subnets": [ + "subnet-0d4703177afb1797d", + "subnet-04262fc338f638054", + "subnet-044457c061edf85f2", + "subnet-04019d42d5c9e6fb9", + "subnet-049778993fb504a7c" + ], + "Type": "application" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/alb/Resource" + } + }, + "albHTTPSListener7C8C4C55": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "Certificates": [ + { + "CertificateArn": "arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da" + } + ], + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "albHTTPSListenerBackendStageGroup18A8DB5E" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "alb8A8B13C2" + }, + "Port": 443, + "Protocol": "HTTPS" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/alb/HTTPS Listener/Resource" + } + }, + "albHTTPSListenerBackendStageGroup18A8DB5E": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "Port": 443, + "Protocol": "HTTPS", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "false" + } + ], + "TargetType": "instance", + "Targets": [ + { + "Id": "i-0d7ea7b7cc11a2e8f" + } + ], + "VpcId": "vpc-55522232" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource" + } + }, + "PublicDNSD41885E8": { + "Type": "AWS::Route53::RecordSet", + "Properties": { + "HostedZoneId": "Z3IZ3D6V94JEC2", + "Name": "stage-alb.alliancegenome.org.", + "ResourceRecords": [ + { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + ], + "TTL": "300", + "Type": "CNAME" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/Public DNS/Resource" + } + }, + "PrivateDNSEACE6CB2": { + "Type": "AWS::Route53::RecordSet", + "Properties": { + "HostedZoneId": "Z007692222A6W93AZVSPD", + "Name": "stage-alb.alliancegenome.org.", + "ResourceRecords": [ + { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + ], + "TTL": "300", + "Type": "CNAME" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/Private DNS/Resource" + } + }, + "CDKMetadata": { + "Type": "AWS::CDK::Metadata", + "Properties": { + "Analytics": "v2:deflate64:H4sIAAAAAAAA/1WPsWrDQAyGnyX7WcVOM3RsM5RCoWBnL4qsGiUXnbnTJRTjd68dt+Aukn6+DwlV8LSDcoO3VFB7LrwcYWgM6exqTiFHYjexz4Gpgv2XNkw5in2/xpD7N+0ip+TYYzIhH7A9okcl0e5awfDc914ITYK+T+zlzji6ac+/vPYkGeuv8zev+AFjx3a/PiurOLqpGu+2MOwVL1wzhdjO0jI1bOM4x49sfbYFLB+OTkPLcEoP1/IRqhK2m1MSKWJWkwtDvfQfzO4j0CsBAAA=" + }, + "Metadata": { + "aws:cdk:path": "stage-alb-stack/CDKMetadata/Default" + } + } + }, + "Outputs": { + "albDNS": { + "Value": { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/cdk.out/tree.json b/cdk.out/tree.json new file mode 100644 index 000000000..d397d1053 --- /dev/null +++ b/cdk.out/tree.json @@ -0,0 +1,398 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "stage-alb-stack": { + "id": "stage-alb-stack", + "path": "stage-alb-stack", + "children": { + "Docker": { + "id": "Docker", + "path": "stage-alb-stack/Docker", + "children": { + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "stage-alb-stack/Docker/PublicSubnet1", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "stage-alb-stack/Docker/PublicSubnet2", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PublicSubnet3": { + "id": "PublicSubnet3", + "path": "stage-alb-stack/Docker/PublicSubnet3", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PublicSubnet4": { + "id": "PublicSubnet4", + "path": "stage-alb-stack/Docker/PublicSubnet4", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PublicSubnet5": { + "id": "PublicSubnet5", + "path": "stage-alb-stack/Docker/PublicSubnet5", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "stage-alb-stack/Docker/PrivateSubnet1", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "stage-alb-stack/Docker/PrivateSubnet2", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PrivateSubnet3": { + "id": "PrivateSubnet3", + "path": "stage-alb-stack/Docker/PrivateSubnet3", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PrivateSubnet4": { + "id": "PrivateSubnet4", + "path": "stage-alb-stack/Docker/PrivateSubnet4", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "PrivateSubnet5": { + "id": "PrivateSubnet5", + "path": "stage-alb-stack/Docker/PrivateSubnet5", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "default": { + "id": "default", + "path": "stage-alb-stack/default", + "children": { + "from 0.0.0.0_0:443": { + "id": "from 0.0.0.0_0:443", + "path": "stage-alb-stack/default/from 0.0.0.0_0:443", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", + "aws:cdk:cloudformation:props": { + "cidrIp": "0.0.0.0/0", + "description": "Allow from anyone on port 443", + "fromPort": 443, + "groupId": "sg-21ac675b", + "ipProtocol": "tcp", + "toPort": 443 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "Public Zone": { + "id": "Public Zone", + "path": "stage-alb-stack/Public Zone", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "Private Zone": { + "id": "Private Zone", + "path": "stage-alb-stack/Private Zone", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.95.1" + } + }, + "alb": { + "id": "alb", + "path": "stage-alb-stack/alb", + "children": { + "Resource": { + "id": "Resource", + "path": "stage-alb-stack/alb/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "aws:cdk:cloudformation:props": { + "loadBalancerAttributes": [ + { + "key": "deletion_protection.enabled", + "value": "false" + } + ], + "scheme": "internal", + "securityGroups": [ + "sg-21ac675b" + ], + "subnets": [ + "subnet-0d4703177afb1797d", + "subnet-04262fc338f638054", + "subnet-044457c061edf85f2", + "subnet-04019d42d5c9e6fb9", + "subnet-049778993fb504a7c" + ], + "type": "application" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer", + "version": "2.95.1" + } + }, + "HTTPS Listener": { + "id": "HTTPS Listener", + "path": "stage-alb-stack/alb/HTTPS Listener", + "children": { + "Resource": { + "id": "Resource", + "path": "stage-alb-stack/alb/HTTPS Listener/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", + "aws:cdk:cloudformation:props": { + "certificates": [ + { + "certificateArn": "arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da" + } + ], + "defaultActions": [ + { + "type": "forward", + "targetGroupArn": { + "Ref": "albHTTPSListenerBackendStageGroup18A8DB5E" + } + } + ], + "loadBalancerArn": { + "Ref": "alb8A8B13C2" + }, + "port": 443, + "protocol": "HTTPS" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener", + "version": "2.95.1" + } + }, + "Backend StageGroup": { + "id": "Backend StageGroup", + "path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "port": 443, + "protocol": "HTTPS", + "targetGroupAttributes": [ + { + "key": "stickiness.enabled", + "value": "false" + } + ], + "targets": [ + { + "id": "i-0d7ea7b7cc11a2e8f" + } + ], + "targetType": "instance", + "vpcId": "vpc-55522232" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer", + "version": "2.95.1" + } + }, + "Public DNS": { + "id": "Public DNS", + "path": "stage-alb-stack/Public DNS", + "children": { + "Resource": { + "id": "Resource", + "path": "stage-alb-stack/Public DNS/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", + "aws:cdk:cloudformation:props": { + "hostedZoneId": "Z3IZ3D6V94JEC2", + "name": "stage-alb.alliancegenome.org.", + "resourceRecords": [ + { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + ], + "ttl": "300", + "type": "CNAME" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_route53.CnameRecord", + "version": "2.95.1" + } + }, + "Private DNS": { + "id": "Private DNS", + "path": "stage-alb-stack/Private DNS", + "children": { + "Resource": { + "id": "Resource", + "path": "stage-alb-stack/Private DNS/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", + "aws:cdk:cloudformation:props": { + "hostedZoneId": "Z007692222A6W93AZVSPD", + "name": "stage-alb.alliancegenome.org.", + "resourceRecords": [ + { + "Fn::GetAtt": [ + "alb8A8B13C2", + "DNSName" + ] + } + ], + "ttl": "300", + "type": "CNAME" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_route53.CnameRecord", + "version": "2.95.1" + } + }, + "albDNS": { + "id": "albDNS", + "path": "stage-alb-stack/albDNS", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "2.95.1" + } + }, + "CDKMetadata": { + "id": "CDKMetadata", + "path": "stage-alb-stack/CDKMetadata", + "children": { + "Default": { + "id": "Default", + "path": "stage-alb-stack/CDKMetadata/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "stage-alb-stack/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.95.1" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "stage-alb-stack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.95.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.95.1" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.95.1" + } + } +} \ No newline at end of file diff --git a/cdk/cdk-stage.ts b/cdk/cdk-stage.ts new file mode 100644 index 000000000..1514b7b37 --- /dev/null +++ b/cdk/cdk-stage.ts @@ -0,0 +1,13 @@ +#!/usr/bin/env node +import * as cdk from 'aws-cdk-lib'; +import {StageALBStack} from './stage-alb-stack'; + +const app = new cdk.App(); + +new StageALBStack(app, 'stage-alb-stack', { + stackName: 'stage-alb-stack', + env: { + region: process.env.CDK_DEFAULT_REGION, + account: process.env.CDK_DEFAULT_ACCOUNT, + }, +}); diff --git a/cdk/stage-alb-stack.ts b/cdk/stage-alb-stack.ts new file mode 100644 index 000000000..0f67ef573 --- /dev/null +++ b/cdk/stage-alb-stack.ts @@ -0,0 +1,54 @@ +import * as autoscaling from 'aws-cdk-lib/aws-autoscaling'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as route53 from 'aws-cdk-lib/aws-route53'; +import * as route53Targets from 'aws-cdk-lib/aws-route53-targets'; +import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; +import * as targets from 'aws-cdk-lib/aws-elasticloadbalancingv2-targets'; +import * as cdk from 'aws-cdk-lib'; + +export class StageALBStack extends cdk.Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const vpc = ec2.Vpc.fromLookup(this, 'Docker', { vpcName: 'Docker' }); + const sg = ec2.SecurityGroup.fromLookupById(this, 'default', 'sg-21ac675b'); + const cert = elbv2.ListenerCertificate.fromArn('arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da'); + const stage = new targets.InstanceIdTarget('i-0d7ea7b7cc11a2e8f') + const public_zone = route53.HostedZone.fromHostedZoneAttributes(this, 'Public Zone', { zoneName: 'alliancegenome.org', hostedZoneId: 'Z3IZ3D6V94JEC2' }); + const private_zone = route53.HostedZone.fromHostedZoneAttributes(this, 'Private Zone', { zoneName: 'alliancegenome.org', hostedZoneId: 'Z007692222A6W93AZVSPD' }); + + const alb = new elbv2.ApplicationLoadBalancer(this, 'alb', { + vpc, + internetFacing: false, + securityGroup: sg + }); + + new route53.CnameRecord(this, "Public DNS", { + zone: public_zone, + recordName: "stage-alb", + domainName: alb.loadBalancerDnsName, + ttl: cdk.Duration.minutes(5) + }); + new route53.CnameRecord(this, "Private DNS", { + zone: private_zone, + recordName: "stage-alb", + domainName: alb.loadBalancerDnsName, + ttl: cdk.Duration.minutes(5) + }); + + const listener = alb.addListener('HTTPS Listener', { + port: 443, + open: true, + certificates: [cert] + }); + + listener.addTargets("Backend Stage", { + port: 443, + targets: [stage] + }); + + new cdk.CfnOutput(this, 'albDNS', { + value: alb.loadBalancerDnsName + }); + } +} diff --git a/package.json b/package.json index dc8bba819..35e4ec9f1 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,11 @@ "@testing-library/jest-dom": "^5.16.1", "abortcontroller-polyfill": "^1.5.0", "agr_genomefeaturecomponent": "^0.3.24", + "aws-cdk": "^2.95.1", + "aws-cdk-lib": "^2.95.1", + "aws-lambda": "^1.0.7", "bootstrap": "4.6.1", + "constructs": "^10.2.70", "core-js": "^3.6.5", "custom-event-polyfill": "^1.0.6", "d3-selection": "2.0.0", @@ -85,6 +89,7 @@ "regenerator-runtime": "^0.13.7", "reselect": "^2.5.4", "sitemap": "^1.13.0", + "source-map-support": "^0.5.21", "tslib": "^2.0.0", "twin.macro": "2.2.3", "whatwg-fetch": "^3.4.0" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..f26d10908 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "lib": ["es2018", "ESNext.AsyncIterable"], + "allowJs": true, + "checkJs": true, + "removeComments": true, + "resolveJsonModule": true, + "declaration": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "inlineSourceMap": true, + "inlineSources": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true, + "typeRoots": ["./node_modules/@types"], + "isolatedModules": true + }, + "exclude": ["node_modules", "**/node_modules/*", "cdk.out"] +} From 80a2de26e28a9f7081bc87eac3ff911e88b45c20 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Mon, 11 Sep 2023 17:05:04 -0400 Subject: [PATCH 2/3] Removed specific impl files --- .gitignore | 3 + cdk-outputs.json | 5 - cdk.context.json | 98 --- cdk.out/cdk-stack.assets.json | 20 - cdk.out/cdk-stack.template.json | 1097 ------------------------- cdk.out/cdk.out | 1 - cdk.out/manifest.json | 106 --- cdk.out/stage-alb-stack.assets.json | 20 - cdk.out/stage-alb-stack.template.json | 186 ----- cdk.out/tree.json | 398 --------- 10 files changed, 3 insertions(+), 1931 deletions(-) delete mode 100644 cdk-outputs.json delete mode 100644 cdk.context.json delete mode 100644 cdk.out/cdk-stack.assets.json delete mode 100644 cdk.out/cdk-stack.template.json delete mode 100644 cdk.out/cdk.out delete mode 100644 cdk.out/manifest.json delete mode 100644 cdk.out/stage-alb-stack.assets.json delete mode 100644 cdk.out/stage-alb-stack.template.json delete mode 100644 cdk.out/tree.json diff --git a/.gitignore b/.gitignore index 25cdc69bd..90d75eaa9 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ Thumbs.db *.swp +cdk-outputs.json +cdk.context.json +cdk.out diff --git a/cdk-outputs.json b/cdk-outputs.json deleted file mode 100644 index 8278425ae..000000000 --- a/cdk-outputs.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "stage-alb-stack": { - "albDNS": "internal-stage-alb8A-D8N9BHZDT6F2-1821793229.us-east-1.elb.amazonaws.com" - } -} diff --git a/cdk.context.json b/cdk.context.json deleted file mode 100644 index 6e5c33c0e..000000000 --- a/cdk.context.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "availability-zones:account=100225593120:region=us-east-1": [ - "us-east-1a", - "us-east-1b", - "us-east-1c", - "us-east-1d", - "us-east-1e", - "us-east-1f" - ], - "vpc-provider:account=100225593120:filter.tag:Name=Docker:region=us-east-1:returnAsymmetricSubnets=true": { - "vpcId": "vpc-55522232", - "vpcCidrBlock": "172.31.0.0/16", - "ownerAccountId": "100225593120", - "availabilityZones": [], - "subnetGroups": [ - { - "name": "Public", - "type": "Public", - "subnets": [ - { - "subnetId": "subnet-3ebf4477", - "cidr": "172.31.0.0/20", - "availabilityZone": "us-east-1a", - "routeTableId": "rtb-c63af6a0" - }, - { - "subnetId": "subnet-df7c7487", - "cidr": "172.31.16.0/20", - "availabilityZone": "us-east-1b", - "routeTableId": "rtb-c63af6a0" - }, - { - "subnetId": "subnet-81c95ee4", - "cidr": "172.31.64.0/20", - "availabilityZone": "us-east-1c", - "routeTableId": "rtb-c63af6a0" - }, - { - "subnetId": "subnet-ff838bd5", - "cidr": "172.31.48.0/20", - "availabilityZone": "us-east-1d", - "routeTableId": "rtb-c63af6a0" - }, - { - "subnetId": "subnet-af62dca3", - "cidr": "172.31.80.0/20", - "availabilityZone": "us-east-1f", - "routeTableId": "rtb-c63af6a0" - } - ] - }, - { - "name": "Private", - "type": "Private", - "subnets": [ - { - "subnetId": "subnet-0d4703177afb1797d", - "cidr": "172.31.96.0/24", - "availabilityZone": "us-east-1a", - "routeTableId": "rtb-05e12b551f60b37ed" - }, - { - "subnetId": "subnet-04262fc338f638054", - "cidr": "172.31.97.0/24", - "availabilityZone": "us-east-1b", - "routeTableId": "rtb-05e12b551f60b37ed" - }, - { - "subnetId": "subnet-044457c061edf85f2", - "cidr": "172.31.98.0/24", - "availabilityZone": "us-east-1c", - "routeTableId": "rtb-05e12b551f60b37ed" - }, - { - "subnetId": "subnet-04019d42d5c9e6fb9", - "cidr": "172.31.99.0/24", - "availabilityZone": "us-east-1d", - "routeTableId": "rtb-05e12b551f60b37ed" - }, - { - "subnetId": "subnet-049778993fb504a7c", - "cidr": "172.31.101.0/24", - "availabilityZone": "us-east-1f", - "routeTableId": "rtb-05e12b551f60b37ed" - } - ] - } - ] - }, - "security-group:account=100225593120:region=us-east-1:securityGroupName=default:vpcId=vpc-55522232": { - "securityGroupId": "sg-21ac675b", - "allowAllOutbound": false - }, - "security-group:account=100225593120:region=us-east-1:securityGroupId=sg-21ac675b": { - "securityGroupId": "sg-21ac675b", - "allowAllOutbound": false - } -} diff --git a/cdk.out/cdk-stack.assets.json b/cdk.out/cdk-stack.assets.json deleted file mode 100644 index 3c6354600..000000000 --- a/cdk.out/cdk-stack.assets.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "34.0.0", - "files": { - "a4518594ba7b9be03de79203ec8a1006b42513fd59d1dc48d55538a9f27e9c4a": { - "source": { - "path": "cdk-stack.template.json", - "packaging": "file" - }, - "destinations": { - "100225593120-us-east-1": { - "bucketName": "cdk-hnb659fds-assets-100225593120-us-east-1", - "objectKey": "a4518594ba7b9be03de79203ec8a1006b42513fd59d1dc48d55538a9f27e9c4a.json", - "region": "us-east-1", - "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-file-publishing-role-100225593120-us-east-1" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/cdk.out/cdk-stack.template.json b/cdk.out/cdk-stack.template.json deleted file mode 100644 index 7d2dde57f..000000000 --- a/cdk.out/cdk-stack.template.json +++ /dev/null @@ -1,1097 +0,0 @@ -{ - "Resources": { - "vpc555222327AFC16C5": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/Resource" - } - }, - "vpc55522232PublicSubnet1Subnet8C1D3F0B": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1a", - "CidrBlock": "10.0.0.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/Subnet" - } - }, - "vpc55522232PublicSubnet1RouteTable201E0132": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/RouteTable" - } - }, - "vpc55522232PublicSubnet1RouteTableAssociationFC3053F6": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet1RouteTable201E0132" - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet1Subnet8C1D3F0B" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/RouteTableAssociation" - } - }, - "vpc55522232PublicSubnet1DefaultRoute3576EEAF": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpc55522232IGW2124CFCD" - }, - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet1RouteTable201E0132" - } - }, - "DependsOn": [ - "vpc55522232VPCGW0E59A086" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/DefaultRoute" - } - }, - "vpc55522232PublicSubnet1EIP2B529517": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet1" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/EIP" - } - }, - "vpc55522232PublicSubnet1NATGateway8F921A30": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "vpc55522232PublicSubnet1EIP2B529517", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet1Subnet8C1D3F0B" - }, - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "vpc55522232PublicSubnet1DefaultRoute3576EEAF", - "vpc55522232PublicSubnet1RouteTableAssociationFC3053F6" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet1/NATGateway" - } - }, - "vpc55522232PublicSubnet2Subnet82DD7CE0": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1b", - "CidrBlock": "10.0.32.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/Subnet" - } - }, - "vpc55522232PublicSubnet2RouteTableB74BC90B": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/RouteTable" - } - }, - "vpc55522232PublicSubnet2RouteTableAssociation94475C00": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet2RouteTableB74BC90B" - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet2Subnet82DD7CE0" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/RouteTableAssociation" - } - }, - "vpc55522232PublicSubnet2DefaultRoute96F97D0D": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpc55522232IGW2124CFCD" - }, - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet2RouteTableB74BC90B" - } - }, - "DependsOn": [ - "vpc55522232VPCGW0E59A086" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/DefaultRoute" - } - }, - "vpc55522232PublicSubnet2EIP9D615FD5": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet2" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/EIP" - } - }, - "vpc55522232PublicSubnet2NATGatewayCE45ECF6": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "vpc55522232PublicSubnet2EIP9D615FD5", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet2Subnet82DD7CE0" - }, - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "vpc55522232PublicSubnet2DefaultRoute96F97D0D", - "vpc55522232PublicSubnet2RouteTableAssociation94475C00" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet2/NATGateway" - } - }, - "vpc55522232PublicSubnet3SubnetB60D3678": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1c", - "CidrBlock": "10.0.64.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet3" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/Subnet" - } - }, - "vpc55522232PublicSubnet3RouteTableE4B6F284": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet3" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/RouteTable" - } - }, - "vpc55522232PublicSubnet3RouteTableAssociationE9DD046D": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet3RouteTableE4B6F284" - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet3SubnetB60D3678" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/RouteTableAssociation" - } - }, - "vpc55522232PublicSubnet3DefaultRoute4A067F3E": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "vpc55522232IGW2124CFCD" - }, - "RouteTableId": { - "Ref": "vpc55522232PublicSubnet3RouteTableE4B6F284" - } - }, - "DependsOn": [ - "vpc55522232VPCGW0E59A086" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/DefaultRoute" - } - }, - "vpc55522232PublicSubnet3EIP60F7BABB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet3" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/EIP" - } - }, - "vpc55522232PublicSubnet3NATGateway285C26A6": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "vpc55522232PublicSubnet3EIP60F7BABB", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "vpc55522232PublicSubnet3SubnetB60D3678" - }, - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PublicSubnet3" - } - ] - }, - "DependsOn": [ - "vpc55522232PublicSubnet3DefaultRoute4A067F3E", - "vpc55522232PublicSubnet3RouteTableAssociationE9DD046D" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PublicSubnet3/NATGateway" - } - }, - "vpc55522232PrivateSubnet1Subnet2E4DA426": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1a", - "CidrBlock": "10.0.96.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/Subnet" - } - }, - "vpc55522232PrivateSubnet1RouteTableC546D020": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/RouteTable" - } - }, - "vpc55522232PrivateSubnet1RouteTableAssociation98BDECFD": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet1RouteTableC546D020" - }, - "SubnetId": { - "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/RouteTableAssociation" - } - }, - "vpc55522232PrivateSubnet1DefaultRouteD15CA2D8": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "vpc55522232PublicSubnet1NATGateway8F921A30" - }, - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet1RouteTableC546D020" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet1/DefaultRoute" - } - }, - "vpc55522232PrivateSubnet2SubnetBF911E75": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1b", - "CidrBlock": "10.0.128.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/Subnet" - } - }, - "vpc55522232PrivateSubnet2RouteTableC23CB4A9": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/RouteTable" - } - }, - "vpc55522232PrivateSubnet2RouteTableAssociationE7D278B5": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet2RouteTableC23CB4A9" - }, - "SubnetId": { - "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/RouteTableAssociation" - } - }, - "vpc55522232PrivateSubnet2DefaultRoute306FAD64": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "vpc55522232PublicSubnet2NATGatewayCE45ECF6" - }, - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet2RouteTableC23CB4A9" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet2/DefaultRoute" - } - }, - "vpc55522232PrivateSubnet3SubnetC9D7ECC5": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": "us-east-1c", - "CidrBlock": "10.0.160.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet3" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/Subnet" - } - }, - "vpc55522232PrivateSubnet3RouteTable571A2BD8": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232/PrivateSubnet3" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/RouteTable" - } - }, - "vpc55522232PrivateSubnet3RouteTableAssociationF86DE320": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet3RouteTable571A2BD8" - }, - "SubnetId": { - "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/RouteTableAssociation" - } - }, - "vpc55522232PrivateSubnet3DefaultRoute23A9E99F": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "vpc55522232PublicSubnet3NATGateway285C26A6" - }, - "RouteTableId": { - "Ref": "vpc55522232PrivateSubnet3RouteTable571A2BD8" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/PrivateSubnet3/DefaultRoute" - } - }, - "vpc55522232IGW2124CFCD": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/vpc-55522232" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/IGW" - } - }, - "vpc55522232VPCGW0E59A086": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Ref": "vpc55522232IGW2124CFCD" - }, - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/vpc-55522232/VPCGW" - } - }, - "alb8A8B13C2": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internal", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "albSecurityGroup49866104", - "GroupId" - ] - } - ], - "Subnets": [ - { - "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" - }, - { - "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" - }, - { - "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" - } - ], - "Type": "application" - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/Resource" - } - }, - "albSecurityGroup49866104": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Automatically created Security Group for ELB cdkstackalb6DF91EA2", - "SecurityGroupIngress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 80", - "FromPort": 80, - "IpProtocol": "tcp", - "ToPort": 80 - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/SecurityGroup/Resource" - } - }, - "albSecurityGrouptocdkstackasgInstanceSecurityGroup3E3F3E71809881611E": { - "Type": "AWS::EC2::SecurityGroupEgress", - "Properties": { - "Description": "Load balancer to target", - "DestinationSecurityGroupId": { - "Fn::GetAtt": [ - "asgInstanceSecurityGroup5CEB2975", - "GroupId" - ] - }, - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "albSecurityGroup49866104", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "ToPort": 80 - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/SecurityGroup/to cdkstackasgInstanceSecurityGroup3E3F3E71:80" - } - }, - "albListener3EA0B2EF": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "albListenerdefaulttargetGroup79BAE92B" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "alb8A8B13C2" - }, - "Port": 80, - "Protocol": "HTTP" - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/Listener/Resource" - } - }, - "albListenerdefaulttargetGroup79BAE92B": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "HealthCheckIntervalSeconds": 30, - "HealthCheckPath": "/", - "HealthyThresholdCount": 5, - "Port": 80, - "Protocol": "HTTP", - "TargetGroupAttributes": [ - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "instance", - "UnhealthyThresholdCount": 2, - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/Listener/default-targetGroup/Resource" - } - }, - "albListenerstaticRule4F017351": { - "Type": "AWS::ElasticLoadBalancingV2::ListenerRule", - "Properties": { - "Actions": [ - { - "FixedResponseConfig": { - "ContentType": "text/html", - "MessageBody": "

Static ALB Response

", - "StatusCode": "200" - }, - "Type": "fixed-response" - } - ], - "Conditions": [ - { - "Field": "path-pattern", - "PathPatternConfig": { - "Values": [ - "/static" - ] - } - } - ], - "ListenerArn": { - "Ref": "albListener3EA0B2EF" - }, - "Priority": 5 - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/alb/Listener/--staticRule/Resource" - } - }, - "asgInstanceSecurityGroup5CEB2975": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "cdk-stack/asg/InstanceSecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/asg" - } - ], - "VpcId": { - "Ref": "vpc555222327AFC16C5" - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/InstanceSecurityGroup/Resource" - } - }, - "asgInstanceSecurityGroupfromcdkstackalbSecurityGroup20A8C03080818D6412": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "Description": "Load balancer to target", - "FromPort": 80, - "GroupId": { - "Fn::GetAtt": [ - "asgInstanceSecurityGroup5CEB2975", - "GroupId" - ] - }, - "IpProtocol": "tcp", - "SourceSecurityGroupId": { - "Fn::GetAtt": [ - "albSecurityGroup49866104", - "GroupId" - ] - }, - "ToPort": 80 - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/InstanceSecurityGroup/from cdkstackalbSecurityGroup20A8C030:80" - } - }, - "asgInstanceRole8AC4201C": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "Name", - "Value": "cdk-stack/asg" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/InstanceRole/Resource" - } - }, - "asgInstanceProfile4E44E320": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "asgInstanceRole8AC4201C" - } - ] - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/InstanceProfile" - } - }, - "asgLaunchConfig37FDE42B": { - "Type": "AWS::AutoScaling::LaunchConfiguration", - "Properties": { - "IamInstanceProfile": { - "Ref": "asgInstanceProfile4E44E320" - }, - "ImageId": { - "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "InstanceType": "t2.micro", - "SecurityGroups": [ - { - "Fn::GetAtt": [ - "asgInstanceSecurityGroup5CEB2975", - "GroupId" - ] - } - ], - "UserData": { - "Fn::Base64": "#!/bin/bash\nsudo su\nyum install -y httpd\nsystemctl start httpd\nsystemctl enable httpd\necho \"

Hello World from $(hostname -f)

\" > /var/www/html/index.html" - } - }, - "DependsOn": [ - "asgInstanceRole8AC4201C" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/LaunchConfig" - } - }, - "asgASG4D014670": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchConfigurationName": { - "Ref": "asgLaunchConfig37FDE42B" - }, - "MaxSize": "3", - "MinSize": "2", - "Tags": [ - { - "Key": "Name", - "PropagateAtLaunch": true, - "Value": "cdk-stack/asg" - } - ], - "TargetGroupARNs": [ - { - "Ref": "albListenerdefaulttargetGroup79BAE92B" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "vpc55522232PrivateSubnet1Subnet2E4DA426" - }, - { - "Ref": "vpc55522232PrivateSubnet2SubnetBF911E75" - }, - { - "Ref": "vpc55522232PrivateSubnet3SubnetC9D7ECC5" - } - ] - }, - "UpdatePolicy": { - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/ASG" - } - }, - "asgScalingPolicyrequestsperminute5D73703F": { - "Type": "AWS::AutoScaling::ScalingPolicy", - "Properties": { - "AutoScalingGroupName": { - "Ref": "asgASG4D014670" - }, - "PolicyType": "TargetTrackingScaling", - "TargetTrackingConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ALBRequestCountPerTarget", - "ResourceLabel": { - "Fn::Join": [ - "", - [ - { - "Fn::Select": [ - 1, - { - "Fn::Split": [ - "/", - { - "Ref": "albListener3EA0B2EF" - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 2, - { - "Fn::Split": [ - "/", - { - "Ref": "albListener3EA0B2EF" - } - ] - } - ] - }, - "/", - { - "Fn::Select": [ - 3, - { - "Fn::Split": [ - "/", - { - "Ref": "albListener3EA0B2EF" - } - ] - } - ] - }, - "/", - { - "Fn::GetAtt": [ - "albListenerdefaulttargetGroup79BAE92B", - "TargetGroupFullName" - ] - } - ] - ] - } - }, - "TargetValue": 60 - } - }, - "DependsOn": [ - "albListenerstaticRule4F017351", - "albListenerdefaulttargetGroup79BAE92B", - "albListener3EA0B2EF" - ], - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/ScalingPolicyrequests-per-minute/Resource" - } - }, - "asgScalingPolicycpuutilscaling06365506": { - "Type": "AWS::AutoScaling::ScalingPolicy", - "Properties": { - "AutoScalingGroupName": { - "Ref": "asgASG4D014670" - }, - "PolicyType": "TargetTrackingScaling", - "TargetTrackingConfiguration": { - "PredefinedMetricSpecification": { - "PredefinedMetricType": "ASGAverageCPUUtilization" - }, - "TargetValue": 75 - } - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/asg/ScalingPolicycpu-util-scaling/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "v2:deflate64:H4sIAAAAAAAA/31Sy27CMBD8Fu7GFbQ99EgRQpFQGyWIa7UxSzAkdmSvQSjKv9d5kSCqnnZndrQejz3nH+98NoGrnYr9eZrJhJcxgTgzT/2UKOa83BWCLQ9qFy5Z6JJMitglCqnmhi7SjnALSYYDP3ALa7WQQFKru7huVkFYly+gNRBe4cZCIy++HRYHitD4vhe0Tjq0IO/1mKMiFqNwRtJtbbQrGg//EqvUoLVPdKAavmKYgSUpMg37BDJQQqr04sNYFIVPoLnJxs8+mxmaetEDHuukJVSdpu9H8y2Y1N+vtzmGf2yJXBvxGFcMHGkrIPMuvUcP4hbct27AKXFcanWQqTP3l3iStqdvjf8CnutGofYumugfiIpJyHkZ6dZRXwNlqQ4hNPogvbmKRWi1M6KZhmAgR2rj+HZUuPb/dJKKKb1HfrIvl9kbn8/46+RkpZwap0jmyKO2/gL2/416uAIAAA==" - }, - "Metadata": { - "aws:cdk:path": "cdk-stack/CDKMetadata/Default" - } - } - }, - "Parameters": { - "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" - }, - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Outputs": { - "albDNS": { - "Value": { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/cdk.out/cdk.out b/cdk.out/cdk.out deleted file mode 100644 index 2313ab543..000000000 --- a/cdk.out/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"34.0.0"} \ No newline at end of file diff --git a/cdk.out/manifest.json b/cdk.out/manifest.json deleted file mode 100644 index 7647b8e69..000000000 --- a/cdk.out/manifest.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "version": "34.0.0", - "artifacts": { - "stage-alb-stack.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "stage-alb-stack.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "stage-alb-stack": { - "type": "aws:cloudformation:stack", - "environment": "aws://100225593120/us-east-1", - "properties": { - "templateFile": "stage-alb-stack.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-deploy-role-100225593120-us-east-1", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-cfn-exec-role-100225593120-us-east-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-100225593120-us-east-1/3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "stage-alb-stack.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-lookup-role-100225593120-us-east-1", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "stage-alb-stack.assets" - ], - "metadata": { - "/stage-alb-stack/default/from 0.0.0.0_0:443": [ - { - "type": "aws:cdk:logicalId", - "data": "defaultfrom00000443FDCE37BB" - } - ], - "/stage-alb-stack/alb/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "alb8A8B13C2" - } - ], - "/stage-alb-stack/alb/HTTPS Listener/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "albHTTPSListener7C8C4C55" - } - ], - "/stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "albHTTPSListenerBackendStageGroup18A8DB5E" - } - ], - "/stage-alb-stack/Public DNS/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PublicDNSD41885E8" - } - ], - "/stage-alb-stack/Private DNS/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "PrivateDNSEACE6CB2" - } - ], - "/stage-alb-stack/albDNS": [ - { - "type": "aws:cdk:logicalId", - "data": "albDNS" - } - ], - "/stage-alb-stack/CDKMetadata/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "CDKMetadata" - } - ], - "/stage-alb-stack/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/stage-alb-stack/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "stage-alb-stack" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - } - } -} \ No newline at end of file diff --git a/cdk.out/stage-alb-stack.assets.json b/cdk.out/stage-alb-stack.assets.json deleted file mode 100644 index 62cd4b0d1..000000000 --- a/cdk.out/stage-alb-stack.assets.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "34.0.0", - "files": { - "3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b": { - "source": { - "path": "stage-alb-stack.template.json", - "packaging": "file" - }, - "destinations": { - "100225593120-us-east-1": { - "bucketName": "cdk-hnb659fds-assets-100225593120-us-east-1", - "objectKey": "3a2577e14946ca0614397f637d69c1a3786b28baa3a527e7bc1dc110e89ce09b.json", - "region": "us-east-1", - "assumeRoleArn": "arn:${AWS::Partition}:iam::100225593120:role/cdk-hnb659fds-file-publishing-role-100225593120-us-east-1" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/cdk.out/stage-alb-stack.template.json b/cdk.out/stage-alb-stack.template.json deleted file mode 100644 index fb15d30e1..000000000 --- a/cdk.out/stage-alb-stack.template.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "Resources": { - "defaultfrom00000443FDCE37BB": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "CidrIp": "0.0.0.0/0", - "Description": "Allow from anyone on port 443", - "FromPort": 443, - "GroupId": "sg-21ac675b", - "IpProtocol": "tcp", - "ToPort": 443 - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/default/from 0.0.0.0_0:443" - } - }, - "alb8A8B13C2": { - "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties": { - "LoadBalancerAttributes": [ - { - "Key": "deletion_protection.enabled", - "Value": "false" - } - ], - "Scheme": "internal", - "SecurityGroups": [ - "sg-21ac675b" - ], - "Subnets": [ - "subnet-0d4703177afb1797d", - "subnet-04262fc338f638054", - "subnet-044457c061edf85f2", - "subnet-04019d42d5c9e6fb9", - "subnet-049778993fb504a7c" - ], - "Type": "application" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/alb/Resource" - } - }, - "albHTTPSListener7C8C4C55": { - "Type": "AWS::ElasticLoadBalancingV2::Listener", - "Properties": { - "Certificates": [ - { - "CertificateArn": "arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da" - } - ], - "DefaultActions": [ - { - "TargetGroupArn": { - "Ref": "albHTTPSListenerBackendStageGroup18A8DB5E" - }, - "Type": "forward" - } - ], - "LoadBalancerArn": { - "Ref": "alb8A8B13C2" - }, - "Port": 443, - "Protocol": "HTTPS" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/alb/HTTPS Listener/Resource" - } - }, - "albHTTPSListenerBackendStageGroup18A8DB5E": { - "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties": { - "Port": 443, - "Protocol": "HTTPS", - "TargetGroupAttributes": [ - { - "Key": "stickiness.enabled", - "Value": "false" - } - ], - "TargetType": "instance", - "Targets": [ - { - "Id": "i-0d7ea7b7cc11a2e8f" - } - ], - "VpcId": "vpc-55522232" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource" - } - }, - "PublicDNSD41885E8": { - "Type": "AWS::Route53::RecordSet", - "Properties": { - "HostedZoneId": "Z3IZ3D6V94JEC2", - "Name": "stage-alb.alliancegenome.org.", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - ], - "TTL": "300", - "Type": "CNAME" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/Public DNS/Resource" - } - }, - "PrivateDNSEACE6CB2": { - "Type": "AWS::Route53::RecordSet", - "Properties": { - "HostedZoneId": "Z007692222A6W93AZVSPD", - "Name": "stage-alb.alliancegenome.org.", - "ResourceRecords": [ - { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - ], - "TTL": "300", - "Type": "CNAME" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/Private DNS/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "v2:deflate64:H4sIAAAAAAAA/1WPsWrDQAyGnyX7WcVOM3RsM5RCoWBnL4qsGiUXnbnTJRTjd68dt+Aukn6+DwlV8LSDcoO3VFB7LrwcYWgM6exqTiFHYjexz4Gpgv2XNkw5in2/xpD7N+0ip+TYYzIhH7A9okcl0e5awfDc914ITYK+T+zlzji6ac+/vPYkGeuv8zev+AFjx3a/PiurOLqpGu+2MOwVL1wzhdjO0jI1bOM4x49sfbYFLB+OTkPLcEoP1/IRqhK2m1MSKWJWkwtDvfQfzO4j0CsBAAA=" - }, - "Metadata": { - "aws:cdk:path": "stage-alb-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "albDNS": { - "Value": { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/cdk.out/tree.json b/cdk.out/tree.json deleted file mode 100644 index d397d1053..000000000 --- a/cdk.out/tree.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "stage-alb-stack": { - "id": "stage-alb-stack", - "path": "stage-alb-stack", - "children": { - "Docker": { - "id": "Docker", - "path": "stage-alb-stack/Docker", - "children": { - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "stage-alb-stack/Docker/PublicSubnet1", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "stage-alb-stack/Docker/PublicSubnet2", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PublicSubnet3": { - "id": "PublicSubnet3", - "path": "stage-alb-stack/Docker/PublicSubnet3", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PublicSubnet4": { - "id": "PublicSubnet4", - "path": "stage-alb-stack/Docker/PublicSubnet4", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PublicSubnet5": { - "id": "PublicSubnet5", - "path": "stage-alb-stack/Docker/PublicSubnet5", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "stage-alb-stack/Docker/PrivateSubnet1", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "stage-alb-stack/Docker/PrivateSubnet2", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PrivateSubnet3": { - "id": "PrivateSubnet3", - "path": "stage-alb-stack/Docker/PrivateSubnet3", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PrivateSubnet4": { - "id": "PrivateSubnet4", - "path": "stage-alb-stack/Docker/PrivateSubnet4", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "PrivateSubnet5": { - "id": "PrivateSubnet5", - "path": "stage-alb-stack/Docker/PrivateSubnet5", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "default": { - "id": "default", - "path": "stage-alb-stack/default", - "children": { - "from 0.0.0.0_0:443": { - "id": "from 0.0.0.0_0:443", - "path": "stage-alb-stack/default/from 0.0.0.0_0:443", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroupIngress", - "aws:cdk:cloudformation:props": { - "cidrIp": "0.0.0.0/0", - "description": "Allow from anyone on port 443", - "fromPort": 443, - "groupId": "sg-21ac675b", - "ipProtocol": "tcp", - "toPort": 443 - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "Public Zone": { - "id": "Public Zone", - "path": "stage-alb-stack/Public Zone", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "Private Zone": { - "id": "Private Zone", - "path": "stage-alb-stack/Private Zone", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "2.95.1" - } - }, - "alb": { - "id": "alb", - "path": "stage-alb-stack/alb", - "children": { - "Resource": { - "id": "Resource", - "path": "stage-alb-stack/alb/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", - "aws:cdk:cloudformation:props": { - "loadBalancerAttributes": [ - { - "key": "deletion_protection.enabled", - "value": "false" - } - ], - "scheme": "internal", - "securityGroups": [ - "sg-21ac675b" - ], - "subnets": [ - "subnet-0d4703177afb1797d", - "subnet-04262fc338f638054", - "subnet-044457c061edf85f2", - "subnet-04019d42d5c9e6fb9", - "subnet-049778993fb504a7c" - ], - "type": "application" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer", - "version": "2.95.1" - } - }, - "HTTPS Listener": { - "id": "HTTPS Listener", - "path": "stage-alb-stack/alb/HTTPS Listener", - "children": { - "Resource": { - "id": "Resource", - "path": "stage-alb-stack/alb/HTTPS Listener/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", - "aws:cdk:cloudformation:props": { - "certificates": [ - { - "certificateArn": "arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da" - } - ], - "defaultActions": [ - { - "type": "forward", - "targetGroupArn": { - "Ref": "albHTTPSListenerBackendStageGroup18A8DB5E" - } - } - ], - "loadBalancerArn": { - "Ref": "alb8A8B13C2" - }, - "port": 443, - "protocol": "HTTPS" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener", - "version": "2.95.1" - } - }, - "Backend StageGroup": { - "id": "Backend StageGroup", - "path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "stage-alb-stack/alb/HTTPS Listener/Backend StageGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", - "aws:cdk:cloudformation:props": { - "port": 443, - "protocol": "HTTPS", - "targetGroupAttributes": [ - { - "key": "stickiness.enabled", - "value": "false" - } - ], - "targets": [ - { - "id": "i-0d7ea7b7cc11a2e8f" - } - ], - "targetType": "instance", - "vpcId": "vpc-55522232" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer", - "version": "2.95.1" - } - }, - "Public DNS": { - "id": "Public DNS", - "path": "stage-alb-stack/Public DNS", - "children": { - "Resource": { - "id": "Resource", - "path": "stage-alb-stack/Public DNS/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", - "aws:cdk:cloudformation:props": { - "hostedZoneId": "Z3IZ3D6V94JEC2", - "name": "stage-alb.alliancegenome.org.", - "resourceRecords": [ - { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - ], - "ttl": "300", - "type": "CNAME" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_route53.CnameRecord", - "version": "2.95.1" - } - }, - "Private DNS": { - "id": "Private DNS", - "path": "stage-alb-stack/Private DNS", - "children": { - "Resource": { - "id": "Resource", - "path": "stage-alb-stack/Private DNS/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Route53::RecordSet", - "aws:cdk:cloudformation:props": { - "hostedZoneId": "Z007692222A6W93AZVSPD", - "name": "stage-alb.alliancegenome.org.", - "resourceRecords": [ - { - "Fn::GetAtt": [ - "alb8A8B13C2", - "DNSName" - ] - } - ], - "ttl": "300", - "type": "CNAME" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_route53.CfnRecordSet", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_route53.CnameRecord", - "version": "2.95.1" - } - }, - "albDNS": { - "id": "albDNS", - "path": "stage-alb-stack/albDNS", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "2.95.1" - } - }, - "CDKMetadata": { - "id": "CDKMetadata", - "path": "stage-alb-stack/CDKMetadata", - "children": { - "Default": { - "id": "Default", - "path": "stage-alb-stack/CDKMetadata/Default", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnResource", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "stage-alb-stack/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.95.1" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "stage-alb-stack/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "2.95.1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "2.95.1" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "2.95.1" - } - } -} \ No newline at end of file From 768c74ba0fc5baf97f08328727c203c5605483d7 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Mon, 11 Sep 2023 19:36:48 -0400 Subject: [PATCH 3/3] Added additional listener --- Makefile | 3 +++ cdk/stage-alb-stack.ts | 53 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index bd26ec60d..7b158aab2 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ test: run: npm start +alb-deploy: + npx aws-cdk deploy --outputs-file ./cdk-outputs.json + uirun: npm start diff --git a/cdk/stage-alb-stack.ts b/cdk/stage-alb-stack.ts index 0f67ef573..c5ec4cd9e 100644 --- a/cdk/stage-alb-stack.ts +++ b/cdk/stage-alb-stack.ts @@ -11,7 +11,8 @@ export class StageALBStack extends cdk.Stack { super(scope, id, props); const vpc = ec2.Vpc.fromLookup(this, 'Docker', { vpcName: 'Docker' }); - const sg = ec2.SecurityGroup.fromLookupById(this, 'default', 'sg-21ac675b'); + const sg1 = ec2.SecurityGroup.fromLookupById(this, 'default', 'sg-21ac675b'); + const sg2 = ec2.SecurityGroup.fromLookupById(this, 'HTTP/HTTPS', 'sg-0415cab61ab6b45c5'); const cert = elbv2.ListenerCertificate.fromArn('arn:aws:acm:us-east-1:100225593120:certificate/047a56a2-09dd-4857-9f28-32d23650d4da'); const stage = new targets.InstanceIdTarget('i-0d7ea7b7cc11a2e8f') const public_zone = route53.HostedZone.fromHostedZoneAttributes(this, 'Public Zone', { zoneName: 'alliancegenome.org', hostedZoneId: 'Z3IZ3D6V94JEC2' }); @@ -19,10 +20,12 @@ export class StageALBStack extends cdk.Stack { const alb = new elbv2.ApplicationLoadBalancer(this, 'alb', { vpc, - internetFacing: false, - securityGroup: sg + internetFacing: true, + securityGroup: sg1 }); + alb.addSecurityGroup(sg2); + new route53.CnameRecord(this, "Public DNS", { zone: public_zone, recordName: "stage-alb", @@ -36,15 +39,51 @@ export class StageALBStack extends cdk.Stack { ttl: cdk.Duration.minutes(5) }); - const listener = alb.addListener('HTTPS Listener', { + const listener_https = alb.addListener('HTTPS Listener', { port: 443, open: true, certificates: [cert] }); - listener.addTargets("Backend Stage", { - port: 443, - targets: [stage] + listener_https.addTargets("Backend Stage", { + healthCheck: { + path: '/robots.txt', + unhealthyThresholdCount: 3, + healthyThresholdCount: 5, + interval: cdk.Duration.seconds(60), + }, + port: 80, + targets: [stage], + }); + +/* + listener_https.addAction("Redirect to Stage", { + priority: 10, + conditions: [ + elbv2.ListenerCondition.hostHeaders(['stage-alb.alliancegenome.org']), + ], + action: elbv2.ListenerAction.redirect({ + protocol: 'HTTPS', + port: '443', + host: 'stage.alliancegenome.org', + path: '/#{path}', + query: '#{query}', + permanent: true, + }), + }); +*/ + + const listener_http = alb.addListener('HTTP Listener', { + port: 80, + open: true, + defaultAction: elbv2.ListenerAction.redirect({ + protocol: 'HTTPS', + port: '443', + host: 'stage.alliancegenome.org', + path: '/#{path}', + query: '#{query}', + permanent: true, + }), }); new cdk.CfnOutput(this, 'albDNS', {