Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[route53] Support for health checks #9481

Open
2 tasks
justin8 opened this issue Aug 6, 2020 · 9 comments
Open
2 tasks

[route53] Support for health checks #9481

justin8 opened this issue Aug 6, 2020 · 9 comments
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@justin8
Copy link
Contributor

justin8 commented Aug 6, 2020

Currently the only way to define a health check or even to enable health checks for alias targets appears to be using Cfn resources instead of the higher level constructs.

Use Case

Route53 health checks are commonly used for multi-region architectures, and not being able to create them is a little limiting

Proposed Solution

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@justin8 justin8 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 6, 2020
@github-actions github-actions bot added the @aws-cdk/aws-route53 Related to Amazon Route 53 label Aug 6, 2020
@shivlaks shivlaks added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2020
@shivlaks
Copy link
Contributor

shivlaks commented Aug 7, 2020

@justin8 I agree this is a pretty important missing feature. marking it as a p1 to help us prioritize getting it implemented and added in.

@NGL321 NGL321 assigned njlynch and unassigned shivlaks Jan 25, 2021
@elhedran
Copy link
Contributor

elhedran commented Jun 25, 2021

Trying to work around this open ticket... not sure this is right though. Deployment seems to get stuck.

import { determineFullyQualifiedDomainName } from '@aws-cdk/aws-route53/lib/util'

// ...

const alias = new route53_targets.ApiGatewayv2DomainProperties(
    domainName.regionalDomainName, domainName.regionalHostedZoneId
)
const target = route53.RecordTarget.fromAlias(alias)

// latency based routing with health check
const gwStack = core.Stack.of(gw)
const healthCheck = new route53.CfnHealthCheck(this, 'healthCheck', {
    healthCheckConfig: {
        fullyQualifiedDomainName:
            `${gw.apiId}.execute-api.${gwStack.region}.${gwStack.urlSuffix}`,
        type: 'HTTPS',
        measureLatency: true
    }
})

new route53.CfnRecordSet(this, 'aRecordSet', {
    aliasTarget: {
        dnsName: domainName.regionalDomainName,
        hostedZoneId: domainName.regionalHostedZoneId,
        evaluateTargetHealth: true
    },
    name: determineFullyQualifiedDomainName(siteName, hostedZone),
    hostedZoneId: hostedZone.hostedZoneId,
    resourceRecords: target.values,
    type: route53.RecordType.A,
    region: gwStack.region,
    setIdentifier: id,
    healthCheckId: healthCheck.attrHealthCheckId
})

I'll update if I work out something better, but wanted to put what I had so far down given this has been open a while now.

This seems to work on a fresh push of a stack... still not sure on the update path. Taking the long game this time and giving the updated stack as much time as it needs (e.g. hours if need be)

@Fitmavincent
Copy link

Before this feature is available in the new release, do we have any way to associate a Cloudwatch Alarm with the Route53 Health Check in CDK?

@OGoodness
Copy link

Any update on this?

@pflorek
Copy link
Contributor

pflorek commented Oct 21, 2022

Here is a small custom construct that should work with the higher level RecordSet. Supports Endpoint, Alarm and Calculated health checks. Has method to retrieve metrics for CloudWatch Alarms and methods to configure failover.

cdk-route53-health-check
diagram

@pahud pahud added p2 and removed p1 labels Jun 11, 2024
Copy link

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

@wladyslawczyzewski
Copy link
Contributor

for those who are waiting for this: I have already opened the PR for alias records health checks and now I'm also working on regular health checks expecting the PR to be ready in a few days 🤞

@wladyslawczyzewski
Copy link
Contributor

two PRs are waiting for review & merge – first one for alias target health evaluation & second one for AWS::Route53::HealthCheck resources

mergify bot pushed a commit that referenced this issue Dec 10, 2024
### Issue # (if applicable)

Part of #9481 
Another PR for this ticket #30664 

### Reason for this change

Added L2 construct for `AWS::Route53::HealthCheck` resource

### Description of changes

The changes only introduces the L2 construct for Route53 health check resources. Except the L2 construct itself, I added basic validations for the input props.

### Description of how you validated changes

- unit tests
- integration tests

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this issue Dec 11, 2024
…9481) (#30664)

### Issue # (if applicable)

Part of a bigger piece of work for #9481 
Another PR for this ticket #30739 

### Reason for this change

At this moment constructing the Route53 health checks is available only via L1 construct, this PR is one of the series to introduce the R53 health checks via higher-level constructs.

### Description of changes

The underlying L1 construct of a few L2 constructs for Alias targets already has the `EvaluateTargetHealth` property, so by adding this prop to the L2 construct we get the quick win to introduce the health checks for Alias records.

### Description of how you validated changes

- unit tests
- integration tests

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@wladyslawczyzewski
Copy link
Contributor

both PRs merged - health checks are now available in AWS CDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

No branches or pull requests

9 participants