Parcourir la source

Fix golden files after rebase

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof il y a 5 ans
Parent
commit
8cd4a6fe9b

+ 44 - 7
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"
               }
             ]
           }

+ 44 - 7
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"
               }
             ]
           }