bazaarvoice / cloudformation-ruby-dsl

Ruby DSL for creating Cloudformation templates
Apache License 2.0
210 stars 76 forks source link

False `diff` output and incorrect exit code #115

Open roman-parkhunovskyi opened 7 years ago

roman-parkhunovskyi commented 7 years ago

Trying to update a CF stack with a few security group resources in it. It outputs a difference which in fact is not.

$ ./stack.rb diff stack-securitygroup
====== Template ======
+    "Pingdom3": {
+      "Type": "AWS::EC2::SecurityGroup",
+      "Properties": {
+        "GroupDescription": "Pingdom Probe IP Addresses",
+        "VpcId": {
+          "Fn::GetAtt": [
+            "CustomVPCResource",
+            "VpcId"
+          ]
+        },
+        "SecurityGroupIngress": [
+          {
+            "IpProtocol": "tcp",
+            "FromPort": "0",
+            "ToPort": "65535",
+            "CidrIp": "208.64.28.194/32"
+          },
+          {
+            "IpProtocol": "tcp",
+            "FromPort": "0",
+            "ToPort": "65535",
+            "CidrIp": "209.126.117.87/32"
+          },
+          {
+            "IpProtocol": "tcp",
+            "FromPort": "0",
+            "ToPort": "65535",
+            "CidrIp": "209.126.120.29/32"
+          },
+          {
+            "IpProtocol": "tcp",
+            "FromPort": "0",
+            "ToPort": "65535",
+            "CidrIp": "211.44.63.35/32"
+          }
+        ]
+      }
+    },
-    "Pingdom3": {
-      "Type": "AWS::EC2::SecurityGroup",
-      "Properties": {
-        "GroupDescription": "Pingdom Probe IP Addresses",
-        "VpcId": {
-          "Fn::GetAtt": [
-            "CustomVPCResource",
-            "VpcId"
-          ]
-        },
-        "SecurityGroupIngress": [
-          {
-            "IpProtocol": "tcp",
-            "FromPort": "0",
-            "ToPort": "65535",
-            "CidrIp": "208.64.28.194/32"
-          },
-          {
-            "IpProtocol": "tcp",
-            "FromPort": "0",
-            "ToPort": "65535",
-            "CidrIp": "209.126.117.87/32"
-          },
-          {
-            "IpProtocol": "tcp",
-            "FromPort": "0",
-            "ToPort": "65535",
-            "CidrIp": "209.126.120.29/32"
-          },
-          {
-            "IpProtocol": "tcp",
-            "FromPort": "0",
-            "ToPort": "65535",
-            "CidrIp": "211.44.63.35/32"
-          }
-        ]
-      }
-    },
-    "Pingdom2SecurityGroup": {
+    "Pingdom3SecurityGroup": {
-        "Ref": "Pingdom2"
+        "Ref": "Pingdom3"
-    "Pingdom3SecurityGroup": {
+    "Pingdom2SecurityGroup": {
-        "Ref": "Pingdom3"
+        "Ref": "Pingdom2"
======================

$ echo $?
2

This returns 2 which means that stack has changes for updating: Ok, let's do it:

$ ./stack.rb update stack-securitygroup
Failed to update stack: No updates are to be performed.

$ echo $?
1

cloudformation-ruby-dsl 1.2.3. Not trying higher version due to another bug: https://github.com/bazaarvoice/cloudformation-ruby-dsl/issues/110

temujin9 commented 7 years ago

@rparkhunovsky Can you try this with the newest version, now that the blocker is closed?

roman-parkhunovskyi commented 7 years ago

@temujin9 , it's still reproducible with 1.4.4