From 71c448f65f6acbd2440def8a17aee44a41489c0d Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 29 Jun 2021 14:25:57 +0800 Subject: [PATCH] chore: some minor fix (#1) Fixes # --- .projen/deps.json | 5 + .projen/tasks.json | 2 +- .projenrc.js | 1 + package.json | 1 + src/app/Dockerfile | 8 +- src/app/src/config.ts | 2 +- src/main.ts | 20 +- test/__snapshots__/main.test.ts.snap | 748 +++++++++++++++++++++++++++ yarn.lock | 2 +- 9 files changed, 783 insertions(+), 6 deletions(-) create mode 100644 test/__snapshots__/main.test.ts.snap diff --git a/.projen/deps.json b/.projen/deps.json index c43ad1805..302bfdfec 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -78,6 +78,11 @@ "version": "^1.110.0", "type": "runtime" }, + { + "name": "@aws-cdk/aws-ec2", + "version": "^1.110.0", + "type": "runtime" + }, { "name": "@aws-cdk/aws-ecs-patterns", "version": "^1.110.0", diff --git a/.projen/tasks.json b/.projen/tasks.json index ba845019e..6c0a408bf 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -120,7 +120,7 @@ "exec": "yarn install --check-files" }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk eslint eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import jest jest-junit json-schema npm-check-updates ts-jest ts-node typescript @aws-cdk/assert @aws-cdk/aws-ecs-patterns @aws-cdk/aws-ecs @aws-cdk/core" + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk eslint eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import jest jest-junit json-schema npm-check-updates ts-jest ts-node typescript @aws-cdk/assert @aws-cdk/aws-ec2 @aws-cdk/aws-ecs-patterns @aws-cdk/aws-ecs @aws-cdk/core" }, { "exec": "npx projen" diff --git a/.projenrc.js b/.projenrc.js index 92de8c2b4..9e429b0f2 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -6,6 +6,7 @@ const project = new AwsCdkTypeScriptApp({ // projenVersion: '^0.24.12', cdkDependencies: [ /* Which AWS CDK modules (those that start with "@aws-cdk/") this app uses. */ + '@aws-cdk/aws-ec2', '@aws-cdk/aws-ecs', '@aws-cdk/aws-ecs-patterns', ], diff --git a/package.json b/package.json index fb89d9191..832662581 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "@aws-cdk/assert": "^1.110.0", + "@aws-cdk/aws-ec2": "^1.110.0", "@aws-cdk/aws-ecs": "^1.110.0", "@aws-cdk/aws-ecs-patterns": "^1.110.0", "@aws-cdk/core": "^1.110.0" diff --git a/src/app/Dockerfile b/src/app/Dockerfile index 17b920c79..ad27463f5 100644 --- a/src/app/Dockerfile +++ b/src/app/Dockerfile @@ -1,5 +1,8 @@ FROM node:14-slim as builder +RUN mkdir /app && \ + chown node /app + USER node WORKDIR /app @@ -15,6 +18,9 @@ RUN yarn build FROM node:14-slim +RUN mkdir /app && \ + chown node /app + USER node WORKDIR /app @@ -30,6 +36,6 @@ RUN yarn --production \ COPY --from=builder /app/lib /app/lib -EXPOSE 80 +EXPOSE 8080 CMD ["node_modules/.bin/pm2-runtime", "/app/lib/index.js"] diff --git a/src/app/src/config.ts b/src/app/src/config.ts index 01ef0b46b..995bd1576 100644 --- a/src/app/src/config.ts +++ b/src/app/src/config.ts @@ -1,3 +1,3 @@ export default { - port: 80, + port: 8080, }; \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 99a0a0863..a15f6e703 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,5 @@ import * as path from 'path'; +import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as ecsPatterns from '@aws-cdk/aws-ecs-patterns'; import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; @@ -8,12 +9,18 @@ export class ImageHandlerStack extends Stack { constructor(scope: Construct, id: string, props: StackProps = {}) { super(scope, id, props); + const cluster = new ecs.Cluster(this, 'Cluster', { + vpc: getOrCreateVpc(this), + }); + const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Service', { memoryLimitMiB: 1024, cpu: 512, + cluster, desiredCount: 2, taskImageOptions: { image: ecs.ContainerImage.fromAsset(path.join(__dirname, 'app')), + containerPort: 8080, }, }); @@ -25,11 +32,20 @@ export class ImageHandlerStack extends Stack { const env = { account: process.env.CDK_DEFAULT_ACCOUNT, - region: 'us-west-2', + region: process.env.CDK_DEFAULT_REGION || 'us-west-2', }; const app = new App(); new ImageHandlerStack(app, 'cdk-image-handler', { env }); -app.synth(); \ No newline at end of file +app.synth(); + +function getOrCreateVpc(scope: Construct): ec2.IVpc { + // use an existing vpc or create a new one + return scope.node.tryGetContext('use_default_vpc') === '1' + || process.env.CDK_USE_DEFAULT_VPC === '1' ? ec2.Vpc.fromLookup(scope, 'Vpc', { isDefault: true }) : + scope.node.tryGetContext('use_vpc_id') ? + ec2.Vpc.fromLookup(scope, 'Vpc', { vpcId: scope.node.tryGetContext('use_vpc_id') }) : + new ec2.Vpc(scope, 'Vpc', { maxAzs: 3, natGateways: 1 }); +} \ No newline at end of file diff --git a/test/__snapshots__/main.test.ts.snap b/test/__snapshots__/main.test.ts.snap new file mode 100644 index 000000000..cb6ce1388 --- /dev/null +++ b/test/__snapshots__/main.test.ts.snap @@ -0,0 +1,748 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Snapshot 1`] = ` +Object { + "Outputs": Object { + "ServiceLoadBalancerDNSEC5B149E": Object { + "Value": Object { + "Fn::GetAtt": Array [ + "ServiceLBE9A1ADBC", + "DNSName", + ], + }, + }, + "ServiceServiceURL250C0FB6": Object { + "Value": Object { + "Fn::Join": Array [ + "", + Array [ + "http://", + Object { + "Fn::GetAtt": Array [ + "ServiceLBE9A1ADBC", + "DNSName", + ], + }, + ], + ], + }, + }, + }, + "Resources": Object { + "ClusterEB0386A7": Object { + "Type": "AWS::ECS::Cluster", + }, + "Service9571FDD8": Object { + "DependsOn": Array [ + "ServiceLBPublicListenerECSGroup0CC8688C", + "ServiceLBPublicListener46709EAA", + ], + "Properties": Object { + "Cluster": Object { + "Ref": "ClusterEB0386A7", + }, + "DeploymentConfiguration": Object { + "MaximumPercent": 200, + "MinimumHealthyPercent": 50, + }, + "DesiredCount": 2, + "EnableECSManagedTags": false, + "HealthCheckGracePeriodSeconds": 60, + "LaunchType": "FARGATE", + "LoadBalancers": Array [ + Object { + "ContainerName": "web", + "ContainerPort": 8080, + "TargetGroupArn": Object { + "Ref": "ServiceLBPublicListenerECSGroup0CC8688C", + }, + }, + ], + "NetworkConfiguration": Object { + "AwsvpcConfiguration": Object { + "AssignPublicIp": "DISABLED", + "SecurityGroups": Array [ + Object { + "Fn::GetAtt": Array [ + "ServiceSecurityGroupEEA09B68", + "GroupId", + ], + }, + ], + "Subnets": Array [ + Object { + "Ref": "VpcPrivateSubnet1Subnet536B997A", + }, + Object { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1", + }, + ], + }, + }, + "TaskDefinition": Object { + "Ref": "ServiceTaskDef1922A00F", + }, + }, + "Type": "AWS::ECS::Service", + }, + "ServiceLBE9A1ADBC": Object { + "DependsOn": Array [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet2DefaultRoute97F91067", + ], + "Properties": Object { + "LoadBalancerAttributes": Array [ + Object { + "Key": "deletion_protection.enabled", + "Value": "false", + }, + ], + "Scheme": "internet-facing", + "SecurityGroups": Array [ + Object { + "Fn::GetAtt": Array [ + "ServiceLBSecurityGroupF7435A5C", + "GroupId", + ], + }, + ], + "Subnets": Array [ + Object { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4", + }, + Object { + "Ref": "VpcPublicSubnet2Subnet691E08A3", + }, + ], + "Type": "application", + }, + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + }, + "ServiceLBPublicListener46709EAA": Object { + "Properties": Object { + "DefaultActions": Array [ + Object { + "TargetGroupArn": Object { + "Ref": "ServiceLBPublicListenerECSGroup0CC8688C", + }, + "Type": "forward", + }, + ], + "LoadBalancerArn": Object { + "Ref": "ServiceLBE9A1ADBC", + }, + "Port": 80, + "Protocol": "HTTP", + }, + "Type": "AWS::ElasticLoadBalancingV2::Listener", + }, + "ServiceLBPublicListenerECSGroup0CC8688C": Object { + "Properties": Object { + "HealthCheckPath": "/", + "Port": 80, + "Protocol": "HTTP", + "TargetType": "ip", + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + }, + "ServiceLBSecurityGroupF7435A5C": Object { + "Properties": Object { + "GroupDescription": "Automatically created Security Group for ELB testServiceLB586D6618", + "SecurityGroupIngress": Array [ + Object { + "CidrIp": "0.0.0.0/0", + "Description": "Allow from anyone on port 80", + "FromPort": 80, + "IpProtocol": "tcp", + "ToPort": 80, + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::SecurityGroup", + }, + "ServiceLBSecurityGrouptotestServiceSecurityGroup5150CB518080B252CBA9": Object { + "Properties": Object { + "Description": "Load balancer to target", + "DestinationSecurityGroupId": Object { + "Fn::GetAtt": Array [ + "ServiceSecurityGroupEEA09B68", + "GroupId", + ], + }, + "FromPort": 8080, + "GroupId": Object { + "Fn::GetAtt": Array [ + "ServiceLBSecurityGroupF7435A5C", + "GroupId", + ], + }, + "IpProtocol": "tcp", + "ToPort": 8080, + }, + "Type": "AWS::EC2::SecurityGroupEgress", + }, + "ServiceSecurityGroupEEA09B68": Object { + "Properties": Object { + "GroupDescription": "test/Service/Service/SecurityGroup", + "SecurityGroupEgress": Array [ + Object { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::SecurityGroup", + }, + "ServiceSecurityGroupfromtestServiceLBSecurityGroup070396498080F83BA643": Object { + "Properties": Object { + "Description": "Load balancer to target", + "FromPort": 8080, + "GroupId": Object { + "Fn::GetAtt": Array [ + "ServiceSecurityGroupEEA09B68", + "GroupId", + ], + }, + "IpProtocol": "tcp", + "SourceSecurityGroupId": Object { + "Fn::GetAtt": Array [ + "ServiceLBSecurityGroupF7435A5C", + "GroupId", + ], + }, + "ToPort": 8080, + }, + "Type": "AWS::EC2::SecurityGroupIngress", + }, + "ServiceTaskDef1922A00F": Object { + "Properties": Object { + "ContainerDefinitions": Array [ + Object { + "Essential": true, + "Image": Object { + "Fn::Join": Array [ + "", + Array [ + Object { + "Ref": "AWS::AccountId", + }, + ".dkr.ecr.", + Object { + "Ref": "AWS::Region", + }, + ".", + Object { + "Ref": "AWS::URLSuffix", + }, + "/aws-cdk/assets:4fe12d7830af1267a47f82d4f8563272f5ad8ed1e26741f1df2a47aec2a9ba39", + ], + ], + }, + "LogConfiguration": Object { + "LogDriver": "awslogs", + "Options": Object { + "awslogs-group": Object { + "Ref": "ServiceTaskDefwebLogGroup2A898F61", + }, + "awslogs-region": Object { + "Ref": "AWS::Region", + }, + "awslogs-stream-prefix": "Service", + }, + }, + "Name": "web", + "PortMappings": Array [ + Object { + "ContainerPort": 8080, + "Protocol": "tcp", + }, + ], + }, + ], + "Cpu": "512", + "ExecutionRoleArn": Object { + "Fn::GetAtt": Array [ + "ServiceTaskDefExecutionRole919F7BE3", + "Arn", + ], + }, + "Family": "testServiceTaskDef70FA6280", + "Memory": "1024", + "NetworkMode": "awsvpc", + "RequiresCompatibilities": Array [ + "FARGATE", + ], + "TaskRoleArn": Object { + "Fn::GetAtt": Array [ + "ServiceTaskDefTaskRole0CFE2F57", + "Arn", + ], + }, + }, + "Type": "AWS::ECS::TaskDefinition", + }, + "ServiceTaskDefExecutionRole919F7BE3": Object { + "Properties": Object { + "AssumeRolePolicyDocument": Object { + "Statement": Array [ + Object { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": Object { + "Service": "ecs-tasks.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ServiceTaskDefExecutionRoleDefaultPolicy3073559D": Object { + "Properties": Object { + "PolicyDocument": Object { + "Statement": Array [ + Object { + "Action": Array [ + "ecr:BatchCheckLayerAvailability", + "ecr:GetDownloadUrlForLayer", + "ecr:BatchGetImage", + ], + "Effect": "Allow", + "Resource": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ecr:", + Object { + "Ref": "AWS::Region", + }, + ":", + Object { + "Ref": "AWS::AccountId", + }, + ":repository/aws-cdk/assets", + ], + ], + }, + }, + Object { + "Action": "ecr:GetAuthorizationToken", + "Effect": "Allow", + "Resource": "*", + }, + Object { + "Action": Array [ + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Effect": "Allow", + "Resource": Object { + "Fn::GetAtt": Array [ + "ServiceTaskDefwebLogGroup2A898F61", + "Arn", + ], + }, + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ServiceTaskDefExecutionRoleDefaultPolicy3073559D", + "Roles": Array [ + Object { + "Ref": "ServiceTaskDefExecutionRole919F7BE3", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ServiceTaskDefTaskRole0CFE2F57": Object { + "Properties": Object { + "AssumeRolePolicyDocument": Object { + "Statement": Array [ + Object { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": Object { + "Service": "ecs-tasks.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ServiceTaskDefwebLogGroup2A898F61": Object { + "DeletionPolicy": "Retain", + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + }, + "Vpc8378EB38": Object { + "Properties": Object { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc", + }, + ], + }, + "Type": "AWS::EC2::VPC", + }, + "VpcIGWD7BA715C": Object { + "Properties": Object { + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc", + }, + ], + }, + "Type": "AWS::EC2::InternetGateway", + }, + "VpcPrivateSubnet1DefaultRouteBE02A9ED": Object { + "Properties": Object { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": Object { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA", + }, + "RouteTableId": Object { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500", + }, + }, + "Type": "AWS::EC2::Route", + }, + "VpcPrivateSubnet1RouteTableAssociation70C59FA6": Object { + "Properties": Object { + "RouteTableId": Object { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500", + }, + "SubnetId": Object { + "Ref": "VpcPrivateSubnet1Subnet536B997A", + }, + }, + "Type": "AWS::EC2::SubnetRouteTableAssociation", + }, + "VpcPrivateSubnet1RouteTableB2C5B500": Object { + "Properties": Object { + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PrivateSubnet1", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::RouteTable", + }, + "VpcPrivateSubnet1Subnet536B997A": Object { + "Properties": Object { + "AvailabilityZone": Object { + "Fn::Select": Array [ + 0, + Object { + "Fn::GetAZs": "", + }, + ], + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": Array [ + Object { + "Key": "aws-cdk:subnet-name", + "Value": "Private", + }, + Object { + "Key": "aws-cdk:subnet-type", + "Value": "Private", + }, + Object { + "Key": "Name", + "Value": "test/Vpc/PrivateSubnet1", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::Subnet", + }, + "VpcPrivateSubnet2DefaultRoute060D2087": Object { + "Properties": Object { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": Object { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA", + }, + "RouteTableId": Object { + "Ref": "VpcPrivateSubnet2RouteTableA678073B", + }, + }, + "Type": "AWS::EC2::Route", + }, + "VpcPrivateSubnet2RouteTableA678073B": Object { + "Properties": Object { + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PrivateSubnet2", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::RouteTable", + }, + "VpcPrivateSubnet2RouteTableAssociationA89CAD56": Object { + "Properties": Object { + "RouteTableId": Object { + "Ref": "VpcPrivateSubnet2RouteTableA678073B", + }, + "SubnetId": Object { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1", + }, + }, + "Type": "AWS::EC2::SubnetRouteTableAssociation", + }, + "VpcPrivateSubnet2Subnet3788AAA1": Object { + "Properties": Object { + "AvailabilityZone": Object { + "Fn::Select": Array [ + 1, + Object { + "Fn::GetAZs": "", + }, + ], + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": Array [ + Object { + "Key": "aws-cdk:subnet-name", + "Value": "Private", + }, + Object { + "Key": "aws-cdk:subnet-type", + "Value": "Private", + }, + Object { + "Key": "Name", + "Value": "test/Vpc/PrivateSubnet2", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::Subnet", + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": Object { + "DependsOn": Array [ + "VpcVPCGWBF912B6E", + ], + "Properties": Object { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": Object { + "Ref": "VpcIGWD7BA715C", + }, + "RouteTableId": Object { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E", + }, + }, + "Type": "AWS::EC2::Route", + }, + "VpcPublicSubnet1EIPD7E02669": Object { + "Properties": Object { + "Domain": "vpc", + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet1", + }, + ], + }, + "Type": "AWS::EC2::EIP", + }, + "VpcPublicSubnet1NATGateway4D7517AA": Object { + "Properties": Object { + "AllocationId": Object { + "Fn::GetAtt": Array [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId", + ], + }, + "SubnetId": Object { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4", + }, + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet1", + }, + ], + }, + "Type": "AWS::EC2::NatGateway", + }, + "VpcPublicSubnet1RouteTable6C95E38E": Object { + "Properties": Object { + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet1", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::RouteTable", + }, + "VpcPublicSubnet1RouteTableAssociation97140677": Object { + "Properties": Object { + "RouteTableId": Object { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E", + }, + "SubnetId": Object { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4", + }, + }, + "Type": "AWS::EC2::SubnetRouteTableAssociation", + }, + "VpcPublicSubnet1Subnet5C2D37C4": Object { + "Properties": Object { + "AvailabilityZone": Object { + "Fn::Select": Array [ + 0, + Object { + "Fn::GetAZs": "", + }, + ], + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": Array [ + Object { + "Key": "aws-cdk:subnet-name", + "Value": "Public", + }, + Object { + "Key": "aws-cdk:subnet-type", + "Value": "Public", + }, + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet1", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::Subnet", + }, + "VpcPublicSubnet2DefaultRoute97F91067": Object { + "DependsOn": Array [ + "VpcVPCGWBF912B6E", + ], + "Properties": Object { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": Object { + "Ref": "VpcIGWD7BA715C", + }, + "RouteTableId": Object { + "Ref": "VpcPublicSubnet2RouteTable94F7E489", + }, + }, + "Type": "AWS::EC2::Route", + }, + "VpcPublicSubnet2RouteTable94F7E489": Object { + "Properties": Object { + "Tags": Array [ + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet2", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::RouteTable", + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": Object { + "Properties": Object { + "RouteTableId": Object { + "Ref": "VpcPublicSubnet2RouteTable94F7E489", + }, + "SubnetId": Object { + "Ref": "VpcPublicSubnet2Subnet691E08A3", + }, + }, + "Type": "AWS::EC2::SubnetRouteTableAssociation", + }, + "VpcPublicSubnet2Subnet691E08A3": Object { + "Properties": Object { + "AvailabilityZone": Object { + "Fn::Select": Array [ + 1, + Object { + "Fn::GetAZs": "", + }, + ], + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": Array [ + Object { + "Key": "aws-cdk:subnet-name", + "Value": "Public", + }, + Object { + "Key": "aws-cdk:subnet-type", + "Value": "Public", + }, + Object { + "Key": "Name", + "Value": "test/Vpc/PublicSubnet2", + }, + ], + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::Subnet", + }, + "VpcVPCGWBF912B6E": Object { + "Properties": Object { + "InternetGatewayId": Object { + "Ref": "VpcIGWD7BA715C", + }, + "VpcId": Object { + "Ref": "Vpc8378EB38", + }, + }, + "Type": "AWS::EC2::VPCGatewayAttachment", + }, + }, +} +`; diff --git a/yarn.lock b/yarn.lock index b80b99719..892ce2a90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -215,7 +215,7 @@ constructs "^3.3.69" punycode "^2.1.1" -"@aws-cdk/aws-ec2@1.110.0": +"@aws-cdk/aws-ec2@1.110.0", "@aws-cdk/aws-ec2@^1.110.0": version "1.110.0" resolved "https://registry.yarnpkg.com/@aws-cdk/aws-ec2/-/aws-ec2-1.110.0.tgz#e4fe1be3365a51d3fcb12b544334cdb073c41794" integrity sha512-sfTg/arYW+/GsuSQZRwpKOsW0AwE1X7ss3u2enrORcK6t+ZP0SJSIWRczbj09yak0fkMXBrPSYBfkqgYBxNLog==