aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

AWS::Route53::HealthCheck - [BUG] - Ignores update to HealthCheckConfig.RoutingControlArn #2028

Open tmokmss opened 2 months ago

tmokmss commented 2 months ago

Name of the resource

AWS::Route53::HealthCheck

Resource Name

No response

Issue Description

When I update the property HealthCheckConfig.RoutingControlArn of AWS::Route53::HealthCheck resource, the changeset is successfully deployed but the actual resource does not reflect the update.

Expected Behavior

The changes to HealthCheckConfig.RoutingControlArn is reflected to the actual resource.

Observed Behavior

The changes to HealthCheckConfig.RoutingControlArn is NOT reflected to the actual resource.

Test Cases

First, we deploy the template below:

{
 "Resources": {
  "Cluster": {
   "Type": "AWS::Route53RecoveryControl::Cluster",
   "Properties": {
    "Name": "ARC-Test"
   }
  },
  "RoutingControlPrimary": {
   "Type": "AWS::Route53RecoveryControl::RoutingControl",
   "Properties": {
    "ClusterArn": {
     "Ref": "Cluster"
    },
    "Name": "rc-primary"
   }
  },
  "RoutingControlSecondary": {
   "Type": "AWS::Route53RecoveryControl::RoutingControl",
   "Properties": {
    "ClusterArn": {
     "Ref": "Cluster"
    },
    "Name": "rc-secondary"
   }
  },
  "HealthCheckPrimary": {
   "Type": "AWS::Route53::HealthCheck",
   "Properties": {
    "HealthCheckConfig": {
     "RoutingControlArn": {
      "Ref": "RoutingControlPrimary"
     },
     "Type": "RECOVERY_CONTROL"
    },
    "HealthCheckTags": [
     {
      "Key": "Name",
      "Value": "hc-primary"
     }
    ]
   }
  },
  "HealthCheckSecondary": {
   "Type": "AWS::Route53::HealthCheck",
   "Properties": {
    "HealthCheckConfig": {
     "RoutingControlArn": {
      "Ref": "RoutingControlPrimary"
     },
     "Type": "RECOVERY_CONTROL"
    },
    "HealthCheckTags": [
     {
      "Key": "Name",
      "Value": "hc-secondary"
     }
    ]
   }
  }
 }
}

The rc-primary routing control has two health checks assigned (expected).

Screenshot 2024-04-27 at 16 46 21

And rc-secondary does not have any health check (expected).

Screenshot 2024-04-27 at 17 08 46

Next, update a RoutingControlArn property with the following template:

{
 "Resources": {
  "Cluster": {
   "Type": "AWS::Route53RecoveryControl::Cluster",
   "Properties": {
    "Name": "ARC-Test"
   }
  },
  "RoutingControlPrimary": {
   "Type": "AWS::Route53RecoveryControl::RoutingControl",
   "Properties": {
    "ClusterArn": {
     "Ref": "Cluster"
    },
    "Name": "rc-primary"
   }
  },
  "RoutingControlSecondary": {
   "Type": "AWS::Route53RecoveryControl::RoutingControl",
   "Properties": {
    "ClusterArn": {
     "Ref": "Cluster"
    },
    "Name": "rc-secondary"
   }
  },
  "HealthCheckPrimary": {
   "Type": "AWS::Route53::HealthCheck",
   "Properties": {
    "HealthCheckConfig": {
     "RoutingControlArn": {
      "Ref": "RoutingControlPrimary"
     },
     "Type": "RECOVERY_CONTROL"
    },
    "HealthCheckTags": [
     {
      "Key": "Name",
      "Value": "hc-primary"
     }
    ]
   }
  },
  "HealthCheckSecondary": {
   "Type": "AWS::Route53::HealthCheck",
   "Properties": {
    "HealthCheckConfig": {
     "RoutingControlArn": {
      "Ref": "RoutingControlSecondary"
     },
     "Type": "RECOVERY_CONTROL"
    },
    "HealthCheckTags": [
     {
      "Key": "Name",
      "Value": "hc-secondary"
     }
    ]
   }
  }
 }
}

The diff is:

  "HealthCheckSecondary": {
   "Type": "AWS::Route53::HealthCheck",
   "Properties": {
    "HealthCheckConfig": {
     "RoutingControlArn": {
-      "Ref": "RoutingControlPrimary"
+      "Ref": "RoutingControlSecondary"
     },

Deploy the stack to update the template. Now rc-primary and rc-secondary should be assigned one healthcheck each, but actually rc-primary still has two healthchecks and rc-secondary has none, which means the update is not reflected. (unexpected)

Other Details

No response