Created
August 16, 2020 22:35
-
-
Save richardsonlima/42d08e96cc478d31a8bf05a353e3a00a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Resources": { | |
"amazonecssampleLBF8E7DBED": { | |
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", | |
"Properties": { | |
"Scheme": "internet-facing", | |
"SecurityGroups": [ | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssampleLBSecurityGroup55736652", | |
"GroupId" | |
] | |
} | |
], | |
"Subnets": { | |
"Fn::Split": [ | |
",", | |
{ | |
"Fn::ImportValue": "a001021010" | |
} | |
] | |
}, | |
"Type": "application" | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/LB/Resource" | |
} | |
}, | |
"amazonecssampleLBSecurityGroup55736652": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "Automatically created Security Group for ELB EcsFargateStackamazonecssampleLB4F4BF700", | |
"SecurityGroupIngress": [ | |
{ | |
"CidrIp": "0.0.0.0/0", | |
"Description": "Allow from anyone on port 80", | |
"FromPort": 80, | |
"IpProtocol": "tcp", | |
"ToPort": 80 | |
} | |
], | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/LB/SecurityGroup/Resource" | |
} | |
}, | |
"amazonecssampleLBSecurityGrouptoEcsFargateStackamazonecssampleServiceSecurityGroup59EB129680D7518CD1": { | |
"Type": "AWS::EC2::SecurityGroupEgress", | |
"Properties": { | |
"GroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssampleLBSecurityGroup55736652", | |
"GroupId" | |
] | |
}, | |
"IpProtocol": "tcp", | |
"Description": "Load balancer to target", | |
"DestinationSecurityGroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssampleServiceSecurityGroup120A1640", | |
"GroupId" | |
] | |
}, | |
"FromPort": 80, | |
"ToPort": 80 | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/LB/SecurityGroup/to EcsFargateStackamazonecssampleServiceSecurityGroup59EB1296:80" | |
} | |
}, | |
"amazonecssampleLBPublicListenerDAC9D871": { | |
"Type": "AWS::ElasticLoadBalancingV2::Listener", | |
"Properties": { | |
"DefaultActions": [ | |
{ | |
"TargetGroupArn": { | |
"Ref": "amazonecssampleLBPublicListenerECSGroup65D63633" | |
}, | |
"Type": "forward" | |
} | |
], | |
"LoadBalancerArn": { | |
"Ref": "amazonecssampleLBF8E7DBED" | |
}, | |
"Port": 80, | |
"Protocol": "HTTP" | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/LB/PublicListener/Resource" | |
} | |
}, | |
"amazonecssampleLBPublicListenerECSGroup65D63633": { | |
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup", | |
"Properties": { | |
"Port": 80, | |
"Protocol": "HTTP", | |
"TargetType": "ip", | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/LB/PublicListener/ECSGroup/Resource" | |
} | |
}, | |
"amazonecssampleTaskDefTaskRole527DD07B": { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "ecs-tasks.amazonaws.com" | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/TaskDef/TaskRole/Resource" | |
} | |
}, | |
"amazonecssampleTaskDefF37D3192": { | |
"Type": "AWS::ECS::TaskDefinition", | |
"Properties": { | |
"ContainerDefinitions": [ | |
{ | |
"Essential": true, | |
"Image": "amazon/amazon-ecs-sample", | |
"LogConfiguration": { | |
"LogDriver": "awslogs", | |
"Options": { | |
"awslogs-group": { | |
"Ref": "amazonecssampleTaskDefwebLogGroup910AB31A" | |
}, | |
"awslogs-stream-prefix": "amazon-ecs-sample", | |
"awslogs-region": "us-east-1" | |
} | |
}, | |
"Name": "web", | |
"PortMappings": [ | |
{ | |
"ContainerPort": 80, | |
"Protocol": "tcp" | |
} | |
] | |
} | |
], | |
"Cpu": "256", | |
"ExecutionRoleArn": { | |
"Fn::GetAtt": [ | |
"amazonecssampleTaskDefExecutionRoleF904F4BB", | |
"Arn" | |
] | |
}, | |
"Family": "EcsFargateStackamazonecssampleTaskDef6748CB54", | |
"Memory": "256", | |
"NetworkMode": "awsvpc", | |
"RequiresCompatibilities": [ | |
"FARGATE" | |
], | |
"TaskRoleArn": { | |
"Fn::GetAtt": [ | |
"amazonecssampleTaskDefTaskRole527DD07B", | |
"Arn" | |
] | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/TaskDef/Resource" | |
} | |
}, | |
"amazonecssampleTaskDefwebLogGroup910AB31A": { | |
"Type": "AWS::Logs::LogGroup", | |
"UpdateReplacePolicy": "Retain", | |
"DeletionPolicy": "Retain", | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/TaskDef/web/LogGroup/Resource" | |
} | |
}, | |
"amazonecssampleTaskDefExecutionRoleF904F4BB": { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "ecs-tasks.amazonaws.com" | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/TaskDef/ExecutionRole/Resource" | |
} | |
}, | |
"amazonecssampleTaskDefExecutionRoleDefaultPolicyAFBFE89A": { | |
"Type": "AWS::IAM::Policy", | |
"Properties": { | |
"PolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Effect": "Allow", | |
"Resource": { | |
"Fn::GetAtt": [ | |
"amazonecssampleTaskDefwebLogGroup910AB31A", | |
"Arn" | |
] | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
}, | |
"PolicyName": "amazonecssampleTaskDefExecutionRoleDefaultPolicyAFBFE89A", | |
"Roles": [ | |
{ | |
"Ref": "amazonecssampleTaskDefExecutionRoleF904F4BB" | |
} | |
] | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/TaskDef/ExecutionRole/DefaultPolicy/Resource" | |
} | |
}, | |
"amazonecssampleService537E3215": { | |
"Type": "AWS::ECS::Service", | |
"Properties": { | |
"Cluster": { | |
"Fn::ImportValue": "ClusterName" | |
}, | |
"DeploymentConfiguration": { | |
"MaximumPercent": 200, | |
"MinimumHealthyPercent": 50 | |
}, | |
"DesiredCount": 2, | |
"EnableECSManagedTags": false, | |
"HealthCheckGracePeriodSeconds": 60, | |
"LaunchType": "FARGATE", | |
"LoadBalancers": [ | |
{ | |
"ContainerName": "web", | |
"ContainerPort": 80, | |
"TargetGroupArn": { | |
"Ref": "amazonecssampleLBPublicListenerECSGroup65D63633" | |
} | |
} | |
], | |
"NetworkConfiguration": { | |
"AwsvpcConfiguration": { | |
"AssignPublicIp": "DISABLED", | |
"SecurityGroups": [ | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssampleServiceSecurityGroup120A1640", | |
"GroupId" | |
] | |
} | |
], | |
"Subnets": { | |
"Fn::Split": [ | |
",", | |
{ | |
"Fn::ImportValue": "a001021010" | |
} | |
] | |
} | |
} | |
}, | |
"TaskDefinition": { | |
"Ref": "amazonecssampleTaskDefF37D3192" | |
} | |
}, | |
"DependsOn": [ | |
"amazonecssampleLBPublicListenerECSGroup65D63633", | |
"amazonecssampleLBPublicListenerDAC9D871" | |
], | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/Service/Service" | |
} | |
}, | |
"amazonecssampleServiceSecurityGroup120A1640": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "EcsFargateStack/amazon-ecs-sample/Service/SecurityGroup", | |
"SecurityGroupEgress": [ | |
{ | |
"CidrIp": "0.0.0.0/0", | |
"Description": "Allow all outbound traffic by default", | |
"IpProtocol": "-1" | |
} | |
], | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/Service/SecurityGroup/Resource" | |
} | |
}, | |
"amazonecssampleServiceSecurityGroupfromEcsFargateStackamazonecssampleLBSecurityGroupEB7D5E1980E9221482": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"IpProtocol": "tcp", | |
"Description": "Load balancer to target", | |
"FromPort": 80, | |
"GroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssampleServiceSecurityGroup120A1640", | |
"GroupId" | |
] | |
}, | |
"SourceSecurityGroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssampleLBSecurityGroup55736652", | |
"GroupId" | |
] | |
}, | |
"ToPort": 80 | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-sample/Service/SecurityGroup/from EcsFargateStackamazonecssampleLBSecurityGroupEB7D5E19:80" | |
} | |
}, | |
"amazonecssecretsLB16A1EED4": { | |
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", | |
"Properties": { | |
"Scheme": "internet-facing", | |
"SecurityGroups": [ | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssecretsLBSecurityGroup16D69F30", | |
"GroupId" | |
] | |
} | |
], | |
"Subnets": { | |
"Fn::Split": [ | |
",", | |
{ | |
"Fn::ImportValue": "a001021010" | |
} | |
] | |
}, | |
"Type": "application" | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/LB/Resource" | |
} | |
}, | |
"amazonecssecretsLBSecurityGroup16D69F30": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "Automatically created Security Group for ELB EcsFargateStackamazonecssecretsLB9B2C8843", | |
"SecurityGroupIngress": [ | |
{ | |
"CidrIp": "0.0.0.0/0", | |
"Description": "Allow from anyone on port 80", | |
"FromPort": 80, | |
"IpProtocol": "tcp", | |
"ToPort": 80 | |
} | |
], | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/LB/SecurityGroup/Resource" | |
} | |
}, | |
"amazonecssecretsLBSecurityGrouptoEcsFargateStackamazonecssecretsServiceSecurityGroupD165C0BC80DFA0E5E1": { | |
"Type": "AWS::EC2::SecurityGroupEgress", | |
"Properties": { | |
"GroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsLBSecurityGroup16D69F30", | |
"GroupId" | |
] | |
}, | |
"IpProtocol": "tcp", | |
"Description": "Load balancer to target", | |
"DestinationSecurityGroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsServiceSecurityGroup9940389E", | |
"GroupId" | |
] | |
}, | |
"FromPort": 80, | |
"ToPort": 80 | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/LB/SecurityGroup/to EcsFargateStackamazonecssecretsServiceSecurityGroupD165C0BC:80" | |
} | |
}, | |
"amazonecssecretsLBPublicListenerA396449D": { | |
"Type": "AWS::ElasticLoadBalancingV2::Listener", | |
"Properties": { | |
"DefaultActions": [ | |
{ | |
"TargetGroupArn": { | |
"Ref": "amazonecssecretsLBPublicListenerECSGroup191943C7" | |
}, | |
"Type": "forward" | |
} | |
], | |
"LoadBalancerArn": { | |
"Ref": "amazonecssecretsLB16A1EED4" | |
}, | |
"Port": 80, | |
"Protocol": "HTTP" | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/LB/PublicListener/Resource" | |
} | |
}, | |
"amazonecssecretsLBPublicListenerECSGroup191943C7": { | |
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup", | |
"Properties": { | |
"Port": 80, | |
"Protocol": "HTTP", | |
"TargetType": "ip", | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/LB/PublicListener/ECSGroup/Resource" | |
} | |
}, | |
"amazonecssecretsTaskDefTaskRoleEF45322E": { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "ecs-tasks.amazonaws.com" | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/TaskDef/TaskRole/Resource" | |
} | |
}, | |
"amazonecssecretsTaskDefA2BDFA29": { | |
"Type": "AWS::ECS::TaskDefinition", | |
"Properties": { | |
"ContainerDefinitions": [ | |
{ | |
"Essential": true, | |
"Image": "amazon/amazon-ecs-secrets", | |
"LogConfiguration": { | |
"LogDriver": "awslogs", | |
"Options": { | |
"awslogs-group": { | |
"Ref": "amazonecssecretsTaskDefwebLogGroupA870B540" | |
}, | |
"awslogs-stream-prefix": "amazon-ecs-secrets", | |
"awslogs-region": "us-east-1" | |
} | |
}, | |
"Name": "web", | |
"PortMappings": [ | |
{ | |
"ContainerPort": 80, | |
"Protocol": "tcp" | |
} | |
] | |
} | |
], | |
"Cpu": "256", | |
"ExecutionRoleArn": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsTaskDefExecutionRole3F42C865", | |
"Arn" | |
] | |
}, | |
"Family": "EcsFargateStackamazonecssecretsTaskDefFF3C8E5C", | |
"Memory": "256", | |
"NetworkMode": "awsvpc", | |
"RequiresCompatibilities": [ | |
"FARGATE" | |
], | |
"TaskRoleArn": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsTaskDefTaskRoleEF45322E", | |
"Arn" | |
] | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/TaskDef/Resource" | |
} | |
}, | |
"amazonecssecretsTaskDefwebLogGroupA870B540": { | |
"Type": "AWS::Logs::LogGroup", | |
"UpdateReplacePolicy": "Retain", | |
"DeletionPolicy": "Retain", | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/TaskDef/web/LogGroup/Resource" | |
} | |
}, | |
"amazonecssecretsTaskDefExecutionRole3F42C865": { | |
"Type": "AWS::IAM::Role", | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": "sts:AssumeRole", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "ecs-tasks.amazonaws.com" | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/TaskDef/ExecutionRole/Resource" | |
} | |
}, | |
"amazonecssecretsTaskDefExecutionRoleDefaultPolicyAFB11C7D": { | |
"Type": "AWS::IAM::Policy", | |
"Properties": { | |
"PolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Effect": "Allow", | |
"Resource": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsTaskDefwebLogGroupA870B540", | |
"Arn" | |
] | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
}, | |
"PolicyName": "amazonecssecretsTaskDefExecutionRoleDefaultPolicyAFB11C7D", | |
"Roles": [ | |
{ | |
"Ref": "amazonecssecretsTaskDefExecutionRole3F42C865" | |
} | |
] | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/TaskDef/ExecutionRole/DefaultPolicy/Resource" | |
} | |
}, | |
"amazonecssecretsService0EC31243": { | |
"Type": "AWS::ECS::Service", | |
"Properties": { | |
"Cluster": { | |
"Fn::ImportValue": "ClusterName" | |
}, | |
"DeploymentConfiguration": { | |
"MaximumPercent": 200, | |
"MinimumHealthyPercent": 50 | |
}, | |
"DesiredCount": 2, | |
"EnableECSManagedTags": false, | |
"HealthCheckGracePeriodSeconds": 60, | |
"LaunchType": "FARGATE", | |
"LoadBalancers": [ | |
{ | |
"ContainerName": "web", | |
"ContainerPort": 80, | |
"TargetGroupArn": { | |
"Ref": "amazonecssecretsLBPublicListenerECSGroup191943C7" | |
} | |
} | |
], | |
"NetworkConfiguration": { | |
"AwsvpcConfiguration": { | |
"AssignPublicIp": "DISABLED", | |
"SecurityGroups": [ | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssecretsServiceSecurityGroup9940389E", | |
"GroupId" | |
] | |
} | |
], | |
"Subnets": { | |
"Fn::Split": [ | |
",", | |
{ | |
"Fn::ImportValue": "a001021010" | |
} | |
] | |
} | |
} | |
}, | |
"TaskDefinition": { | |
"Ref": "amazonecssecretsTaskDefA2BDFA29" | |
} | |
}, | |
"DependsOn": [ | |
"amazonecssecretsLBPublicListenerECSGroup191943C7", | |
"amazonecssecretsLBPublicListenerA396449D" | |
], | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/Service/Service" | |
} | |
}, | |
"amazonecssecretsServiceSecurityGroup9940389E": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "EcsFargateStack/amazon-ecs-secrets/Service/SecurityGroup", | |
"SecurityGroupEgress": [ | |
{ | |
"CidrIp": "0.0.0.0/0", | |
"Description": "Allow all outbound traffic by default", | |
"IpProtocol": "-1" | |
} | |
], | |
"VpcId": { | |
"Fn::ImportValue": "a001021010" | |
} | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/Service/SecurityGroup/Resource" | |
} | |
}, | |
"amazonecssecretsServiceSecurityGroupfromEcsFargateStackamazonecssecretsLBSecurityGroupD8C87D9A803B54DB0F": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"IpProtocol": "tcp", | |
"Description": "Load balancer to target", | |
"FromPort": 80, | |
"GroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsServiceSecurityGroup9940389E", | |
"GroupId" | |
] | |
}, | |
"SourceSecurityGroupId": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsLBSecurityGroup16D69F30", | |
"GroupId" | |
] | |
}, | |
"ToPort": 80 | |
}, | |
"Metadata": { | |
"aws:cdk:path": "EcsFargateStack/amazon-ecs-secrets/Service/SecurityGroup/from EcsFargateStackamazonecssecretsLBSecurityGroupD8C87D9A:80" | |
} | |
} | |
}, | |
"Outputs": { | |
"amazonecssampleLoadBalancerDNS70F5FECA": { | |
"Value": { | |
"Fn::GetAtt": [ | |
"amazonecssampleLBF8E7DBED", | |
"DNSName" | |
] | |
} | |
}, | |
"amazonecssampleServiceURLE3D5AC2F": { | |
"Value": { | |
"Fn::Join": [ | |
"", | |
[ | |
"http://", | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssampleLBF8E7DBED", | |
"DNSName" | |
] | |
} | |
] | |
] | |
} | |
}, | |
"amazonecssecretsLoadBalancerDNS76791D51": { | |
"Value": { | |
"Fn::GetAtt": [ | |
"amazonecssecretsLB16A1EED4", | |
"DNSName" | |
] | |
} | |
}, | |
"amazonecssecretsServiceURL3443D762": { | |
"Value": { | |
"Fn::Join": [ | |
"", | |
[ | |
"http://", | |
{ | |
"Fn::GetAtt": [ | |
"amazonecssecretsLB16A1EED4", | |
"DNSName" | |
] | |
} | |
] | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment