浏览代码

Add security group declaration in cloudformation conversion tests

Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
Guillaume Lours 5 年之前
父节点
当前提交
6798ad1245

+ 25 - 0
ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden

@@ -58,6 +58,26 @@
       },
       "Type": "AWS::Logs::LogGroup"
     },
+    "TestSimpleConvertDefaultNetwork": {
+      "Properties": {
+        "GroupDescription": "TestSimpleConvert default Security Group",
+        "GroupName": "TestSimpleConvertDefaultNetwork",
+        "Tags": [
+          {
+            "Key": "com.docker.compose.project",
+            "Value": "TestSimpleConvert"
+          },
+          {
+            "Key": "com.docker.compose.network",
+            "Value": "default"
+          }
+        ],
+        "VpcId": {
+          "Ref": "ParameterVPCId"
+        }
+      },
+      "Type": "AWS::EC2::SecurityGroup"
+    },
     "simpleService": {
       "Properties": {
         "Cluster": {
@@ -76,6 +96,11 @@
         "NetworkConfiguration": {
           "AwsvpcConfiguration": {
             "AssignPublicIp": "ENABLED",
+            "SecurityGroups": [
+              {
+                "Ref": "TestSimpleConvertDefaultNetwork"
+              }
+            ],
             "Subnets": [
               {
                 "Ref": "ParameterSubnet1Id"

+ 25 - 0
ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden

@@ -58,6 +58,26 @@
       },
       "Type": "AWS::Logs::LogGroup"
     },
+    "TestSimpleWithOverridesDefaultNetwork": {
+      "Properties": {
+        "GroupDescription": "TestSimpleWithOverrides default Security Group",
+        "GroupName": "TestSimpleWithOverridesDefaultNetwork",
+        "Tags": [
+          {
+            "Key": "com.docker.compose.project",
+            "Value": "TestSimpleWithOverrides"
+          },
+          {
+            "Key": "com.docker.compose.network",
+            "Value": "default"
+          }
+        ],
+        "VpcId": {
+          "Ref": "ParameterVPCId"
+        }
+      },
+      "Type": "AWS::EC2::SecurityGroup"
+    },
     "simpleService": {
       "Properties": {
         "Cluster": {
@@ -76,6 +96,11 @@
         "NetworkConfiguration": {
           "AwsvpcConfiguration": {
             "AssignPublicIp": "ENABLED",
+            "SecurityGroups": [
+              {
+                "Ref": "TestSimpleWithOverridesDefaultNetwork"
+              }
+            ],
             "Subnets": [
               {
                 "Ref": "ParameterSubnet1Id"