2020-05-13 15:32:24 +02:00
|
|
|
{
|
|
|
|
"AWSTemplateFormatVersion": "2010-09-09",
|
|
|
|
"Resources": {
|
|
|
|
"CloudMap": {
|
|
|
|
"Properties": {
|
|
|
|
"Description": "Service Map for Docker Compose project TestSimpleConvert",
|
|
|
|
"Name": "TestSimpleConvert.local",
|
2020-09-24 16:11:08 +02:00
|
|
|
"Vpc": "vpcID"
|
2020-05-13 15:32:24 +02:00
|
|
|
},
|
|
|
|
"Type": "AWS::ServiceDiscovery::PrivateDnsNamespace"
|
|
|
|
},
|
2020-05-13 22:09:20 +02:00
|
|
|
"Cluster": {
|
|
|
|
"Properties": {
|
|
|
|
"ClusterName": "TestSimpleConvert",
|
|
|
|
"Tags": [
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.project",
|
|
|
|
"Value": "TestSimpleConvert"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Type": "AWS::ECS::Cluster"
|
|
|
|
},
|
2020-09-24 16:11:08 +02:00
|
|
|
"Default80Ingress": {
|
|
|
|
"Properties": {
|
|
|
|
"CidrIp": "0.0.0.0/0",
|
|
|
|
"Description": "simple:80/tcp on default nextwork",
|
|
|
|
"FromPort": 80,
|
|
|
|
"GroupId": {
|
|
|
|
"Ref": "DefaultNetwork"
|
|
|
|
},
|
|
|
|
"IpProtocol": "TCP",
|
|
|
|
"ToPort": 80
|
|
|
|
},
|
|
|
|
"Type": "AWS::EC2::SecurityGroupIngress"
|
|
|
|
},
|
|
|
|
"DefaultNetwork": {
|
|
|
|
"Properties": {
|
|
|
|
"GroupDescription": "TestSimpleConvert Security Group for default network",
|
|
|
|
"GroupName": "DefaultNetwork",
|
|
|
|
"Tags": [
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.project",
|
|
|
|
"Value": "TestSimpleConvert"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.network",
|
|
|
|
"Value": "default"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"VpcId": "vpcID"
|
|
|
|
},
|
|
|
|
"Type": "AWS::EC2::SecurityGroup"
|
|
|
|
},
|
|
|
|
"DefaultNetworkIngress": {
|
|
|
|
"Properties": {
|
|
|
|
"Description": "Allow communication within network default",
|
|
|
|
"GroupId": {
|
|
|
|
"Ref": "DefaultNetwork"
|
|
|
|
},
|
|
|
|
"IpProtocol": "-1",
|
|
|
|
"SourceSecurityGroupId": {
|
|
|
|
"Ref": "DefaultNetwork"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Type": "AWS::EC2::SecurityGroupIngress"
|
|
|
|
},
|
|
|
|
"LoadBalancer": {
|
|
|
|
"Properties": {
|
|
|
|
"Scheme": "internet-facing",
|
|
|
|
"SecurityGroups": [
|
|
|
|
{
|
|
|
|
"Ref": "DefaultNetwork"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Subnets": [
|
|
|
|
"subnet1",
|
|
|
|
"subnet2"
|
|
|
|
],
|
|
|
|
"Tags": [
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.project",
|
|
|
|
"Value": "TestSimpleConvert"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Type": "application"
|
|
|
|
},
|
|
|
|
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer"
|
|
|
|
},
|
2020-05-13 15:32:24 +02:00
|
|
|
"LogGroup": {
|
|
|
|
"Properties": {
|
|
|
|
"LogGroupName": "/docker-compose/TestSimpleConvert"
|
|
|
|
},
|
|
|
|
"Type": "AWS::Logs::LogGroup"
|
|
|
|
},
|
2020-05-27 16:58:58 +02:00
|
|
|
"SimpleService": {
|
2020-07-15 18:02:57 +02:00
|
|
|
"DependsOn": [
|
|
|
|
"SimpleTCP80Listener"
|
|
|
|
],
|
2020-05-13 15:32:24 +02:00
|
|
|
"Properties": {
|
2020-05-13 22:09:20 +02:00
|
|
|
"Cluster": {
|
2020-09-24 16:11:08 +02:00
|
|
|
"Ref": "Cluster"
|
2020-05-13 22:09:20 +02:00
|
|
|
},
|
2020-08-06 10:22:55 +02:00
|
|
|
"DeploymentConfiguration": {
|
|
|
|
"MaximumPercent": 200,
|
|
|
|
"MinimumHealthyPercent": 100
|
|
|
|
},
|
|
|
|
"DeploymentController": {
|
|
|
|
"Type": "ECS"
|
|
|
|
},
|
2020-05-13 15:32:24 +02:00
|
|
|
"DesiredCount": 1,
|
|
|
|
"LaunchType": "FARGATE",
|
2020-07-15 18:02:57 +02:00
|
|
|
"LoadBalancers": [
|
|
|
|
{
|
|
|
|
"ContainerName": "simple",
|
|
|
|
"ContainerPort": 80,
|
|
|
|
"TargetGroupArn": {
|
|
|
|
"Ref": "SimpleTCP80TargetGroup"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2020-05-13 15:32:24 +02:00
|
|
|
"NetworkConfiguration": {
|
|
|
|
"AwsvpcConfiguration": {
|
|
|
|
"AssignPublicIp": "ENABLED",
|
2020-05-18 11:36:42 +02:00
|
|
|
"SecurityGroups": [
|
|
|
|
{
|
2020-09-24 16:11:08 +02:00
|
|
|
"Ref": "DefaultNetwork"
|
2020-05-18 11:36:42 +02:00
|
|
|
}
|
|
|
|
],
|
2020-05-13 15:32:24 +02:00
|
|
|
"Subnets": [
|
2020-09-24 16:11:08 +02:00
|
|
|
"subnet1",
|
|
|
|
"subnet2"
|
2020-05-13 15:32:24 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2020-09-08 10:33:06 +02:00
|
|
|
"PlatformVersion": "1.4.0",
|
2020-08-04 18:20:34 +02:00
|
|
|
"PropagateTags": "SERVICE",
|
2020-05-13 15:32:24 +02:00
|
|
|
"SchedulingStrategy": "REPLICA",
|
|
|
|
"ServiceRegistries": [
|
|
|
|
{
|
|
|
|
"RegistryArn": {
|
|
|
|
"Fn::GetAtt": [
|
2020-05-27 16:58:58 +02:00
|
|
|
"SimpleServiceDiscoveryEntry",
|
2020-05-13 15:32:24 +02:00
|
|
|
"Arn"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2020-05-27 17:00:25 +02:00
|
|
|
"Tags": [
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.project",
|
|
|
|
"Value": "TestSimpleConvert"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.service",
|
|
|
|
"Value": "simple"
|
|
|
|
}
|
|
|
|
],
|
2020-05-13 15:32:24 +02:00
|
|
|
"TaskDefinition": {
|
2020-05-27 16:58:58 +02:00
|
|
|
"Ref": "SimpleTaskDefinition"
|
2020-05-13 15:32:24 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"Type": "AWS::ECS::Service"
|
|
|
|
},
|
2020-05-27 16:58:58 +02:00
|
|
|
"SimpleServiceDiscoveryEntry": {
|
2020-05-13 15:32:24 +02:00
|
|
|
"Properties": {
|
|
|
|
"Description": "\"simple\" service discovery entry in Cloud Map",
|
|
|
|
"DnsConfig": {
|
|
|
|
"DnsRecords": [
|
|
|
|
{
|
2020-05-27 14:34:17 +02:00
|
|
|
"TTL": 60,
|
2020-05-13 15:32:24 +02:00
|
|
|
"Type": "A"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"RoutingPolicy": "MULTIVALUE"
|
|
|
|
},
|
2020-06-15 09:41:01 +02:00
|
|
|
"HealthCheckCustomConfig": {
|
|
|
|
"FailureThreshold": 1
|
|
|
|
},
|
2020-05-13 15:32:24 +02:00
|
|
|
"Name": "simple",
|
|
|
|
"NamespaceId": {
|
|
|
|
"Ref": "CloudMap"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Type": "AWS::ServiceDiscovery::Service"
|
|
|
|
},
|
2020-07-15 18:02:57 +02:00
|
|
|
"SimpleTCP80Listener": {
|
|
|
|
"Properties": {
|
|
|
|
"DefaultActions": [
|
|
|
|
{
|
|
|
|
"ForwardConfig": {
|
|
|
|
"TargetGroups": [
|
|
|
|
{
|
|
|
|
"TargetGroupArn": {
|
|
|
|
"Ref": "SimpleTCP80TargetGroup"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Type": "forward"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"LoadBalancerArn": {
|
2020-09-24 16:11:08 +02:00
|
|
|
"Ref": "LoadBalancer"
|
2020-07-15 18:02:57 +02:00
|
|
|
},
|
|
|
|
"Port": 80,
|
|
|
|
"Protocol": "HTTP"
|
|
|
|
},
|
|
|
|
"Type": "AWS::ElasticLoadBalancingV2::Listener"
|
|
|
|
},
|
|
|
|
"SimpleTCP80TargetGroup": {
|
|
|
|
"Properties": {
|
|
|
|
"Port": 80,
|
|
|
|
"Protocol": "HTTP",
|
|
|
|
"Tags": [
|
|
|
|
{
|
|
|
|
"Key": "com.docker.compose.project",
|
|
|
|
"Value": "TestSimpleConvert"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"TargetType": "ip",
|
2020-09-24 16:11:08 +02:00
|
|
|
"VpcId": "vpcID"
|
2020-07-15 18:02:57 +02:00
|
|
|
},
|
|
|
|
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup"
|
|
|
|
},
|
2020-05-27 16:58:58 +02:00
|
|
|
"SimpleTaskDefinition": {
|
2020-05-13 15:32:24 +02:00
|
|
|
"Properties": {
|
|
|
|
"ContainerDefinitions": [
|
|
|
|
{
|
|
|
|
"Environment": [
|
|
|
|
{
|
|
|
|
"Name": "LOCALDOMAIN",
|
|
|
|
"Value": {
|
|
|
|
"Fn::Join": [
|
|
|
|
"",
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"Ref": "AWS::Region"
|
|
|
|
},
|
|
|
|
".compute.internal",
|
|
|
|
" TestSimpleConvert.local"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Essential": true,
|
2020-07-08 16:07:13 +02:00
|
|
|
"Image": "nginx",
|
2020-05-13 15:32:24 +02:00
|
|
|
"LinuxParameters": {},
|
|
|
|
"LogConfiguration": {
|
|
|
|
"LogDriver": "awslogs",
|
|
|
|
"Options": {
|
|
|
|
"awslogs-group": {
|
|
|
|
"Ref": "LogGroup"
|
|
|
|
},
|
|
|
|
"awslogs-region": {
|
|
|
|
"Ref": "AWS::Region"
|
|
|
|
},
|
2020-05-27 16:58:58 +02:00
|
|
|
"awslogs-stream-prefix": "TestSimpleConvert"
|
2020-05-13 15:32:24 +02:00
|
|
|
}
|
|
|
|
},
|
2020-07-15 18:02:57 +02:00
|
|
|
"Name": "simple",
|
|
|
|
"PortMappings": [
|
|
|
|
{
|
|
|
|
"ContainerPort": 80,
|
|
|
|
"HostPort": 80,
|
|
|
|
"Protocol": "tcp"
|
|
|
|
}
|
|
|
|
]
|
2020-05-13 15:32:24 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"Cpu": "256",
|
|
|
|
"ExecutionRoleArn": {
|
2020-05-27 16:58:58 +02:00
|
|
|
"Ref": "SimpleTaskExecutionRole"
|
2020-05-13 15:32:24 +02:00
|
|
|
},
|
2020-06-02 14:17:48 +02:00
|
|
|
"Family": "TestSimpleConvert-simple",
|
2020-05-13 15:32:24 +02:00
|
|
|
"Memory": "512",
|
|
|
|
"NetworkMode": "awsvpc",
|
|
|
|
"RequiresCompatibilities": [
|
|
|
|
"FARGATE"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Type": "AWS::ECS::TaskDefinition"
|
|
|
|
},
|
2020-05-27 16:58:58 +02:00
|
|
|
"SimpleTaskExecutionRole": {
|
2020-05-13 15:32:24 +02:00
|
|
|
"Properties": {
|
|
|
|
"AssumeRolePolicyDocument": {
|
|
|
|
"Statement": [
|
|
|
|
{
|
|
|
|
"Action": [
|
|
|
|
"sts:AssumeRole"
|
|
|
|
],
|
|
|
|
"Effect": "Allow",
|
|
|
|
"Principal": {
|
|
|
|
"Service": "ecs-tasks.amazonaws.com"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Version": "2012-10-17"
|
|
|
|
},
|
|
|
|
"ManagedPolicyArns": [
|
2020-05-25 16:49:58 +02:00
|
|
|
"arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
|
|
|
|
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
|
2020-05-13 15:32:24 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"Type": "AWS::IAM::Role"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|