From 8cd4a6fe9b257f5658e92b1dd2fc040b75b46d9c Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 13 May 2020 22:09:20 +0200 Subject: [PATCH] Fix golden files after rebase Signed-off-by: Nicolas De Loof --- .../simple-cloudformation-conversion.golden | 51 ++++++++++++++++--- ...formation-with-overrides-conversion.golden | 51 ++++++++++++++++--- 2 files changed, 88 insertions(+), 14 deletions(-) diff --git a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden index 51a528b3..d0e632d9 100644 --- a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden +++ b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden @@ -1,15 +1,29 @@ { "AWSTemplateFormatVersion": "2010-09-09", + "Conditions": { + "CreateCluster": { + "Fn::Equals": [ + "", + { + "Ref": "ParameterClusterName" + } + ] + } + }, "Parameters": { - "Subnet1Id": { + "ParameterClusterName": { + "Description": "Name of the ECS cluster to deploy to (optional)", + "Type": "String" + }, + "ParameterSubnet1Id": { "Description": "SubnetId,for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" }, - "Subnet2Id": { + "ParameterSubnet2Id": { "Description": "SubnetId,for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" }, - "VPCId": { + "ParameterVPCId": { "Description": "ID of the VPC", "Type": "AWS::EC2::VPC::Id" } @@ -20,11 +34,24 @@ "Description": "Service Map for Docker Compose project TestSimpleConvert", "Name": "TestSimpleConvert.local", "Vpc": { - "Ref": "VPCId" + "Ref": "ParameterVPCId" } }, "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace" }, + "Cluster": { + "Condition": "CreateCluster", + "Properties": { + "ClusterName": "TestSimpleConvert", + "Tags": [ + { + "Key": "com.docker.compose.project", + "Value": "TestSimpleConvert" + } + ] + }, + "Type": "AWS::ECS::Cluster" + }, "LogGroup": { "Properties": { "LogGroupName": "/docker-compose/TestSimpleConvert" @@ -33,7 +60,17 @@ }, "simpleService": { "Properties": { - "Cluster": "TestCluster", + "Cluster": { + "Fn::If": [ + "CreateCluster", + { + "Ref": "Cluster" + }, + { + "Ref": "ParameterClusterName" + } + ] + }, "DesiredCount": 1, "LaunchType": "FARGATE", "NetworkConfiguration": { @@ -41,10 +78,10 @@ "AssignPublicIp": "ENABLED", "Subnets": [ { - "Ref": "Subnet1Id" + "Ref": "ParameterSubnet1Id" }, { - "Ref": "Subnet2Id" + "Ref": "ParameterSubnet2Id" } ] } diff --git a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden index 2e8f5a4a..5e641af5 100644 --- a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden +++ b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden @@ -1,15 +1,29 @@ { "AWSTemplateFormatVersion": "2010-09-09", + "Conditions": { + "CreateCluster": { + "Fn::Equals": [ + "", + { + "Ref": "ParameterClusterName" + } + ] + } + }, "Parameters": { - "Subnet1Id": { + "ParameterClusterName": { + "Description": "Name of the ECS cluster to deploy to (optional)", + "Type": "String" + }, + "ParameterSubnet1Id": { "Description": "SubnetId,for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" }, - "Subnet2Id": { + "ParameterSubnet2Id": { "Description": "SubnetId,for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" }, - "VPCId": { + "ParameterVPCId": { "Description": "ID of the VPC", "Type": "AWS::EC2::VPC::Id" } @@ -20,11 +34,24 @@ "Description": "Service Map for Docker Compose project TestSimpleWithOverrides", "Name": "TestSimpleWithOverrides.local", "Vpc": { - "Ref": "VPCId" + "Ref": "ParameterVPCId" } }, "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace" }, + "Cluster": { + "Condition": "CreateCluster", + "Properties": { + "ClusterName": "TestSimpleWithOverrides", + "Tags": [ + { + "Key": "com.docker.compose.project", + "Value": "TestSimpleWithOverrides" + } + ] + }, + "Type": "AWS::ECS::Cluster" + }, "LogGroup": { "Properties": { "LogGroupName": "/docker-compose/TestSimpleWithOverrides" @@ -33,7 +60,17 @@ }, "simpleService": { "Properties": { - "Cluster": "TestCluster", + "Cluster": { + "Fn::If": [ + "CreateCluster", + { + "Ref": "Cluster" + }, + { + "Ref": "ParameterClusterName" + } + ] + }, "DesiredCount": 1, "LaunchType": "FARGATE", "NetworkConfiguration": { @@ -41,10 +78,10 @@ "AssignPublicIp": "ENABLED", "Subnets": [ { - "Ref": "Subnet1Id" + "Ref": "ParameterSubnet1Id" }, { - "Ref": "Subnet2Id" + "Ref": "ParameterSubnet2Id" } ] }