{"id":8861,"library":"aws-cdk-aws-route53","title":"AWS CDK Route 53 Constructs (v1)","description":"The `aws-cdk-aws-route53` library is a part of AWS Cloud Development Kit (CDK) v1, providing higher-level constructs for Amazon Route 53. It enables developers to define Route 53 resources such as hosted zones and various record types using familiar programming languages. While still available, CDK v1 is in maintenance mode, with its end-of-support reached on June 1, 2023. The current version is 1.204.0, and it adheres to a release cadence that has slowed significantly since the release of CDK v2 (`aws-cdk-lib`).","status":"maintenance","version":"1.204.0","language":"en","source_language":"en","source_url":"https://github.com/aws/aws-cdk.git","tags":["aws","cdk","route53","dns","infrastructure-as-code","cloudformation","deprecated"],"install":[{"cmd":"pip install aws-cdk.aws-route53","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core CDK constructs and app management for CDK v1.","package":"aws-cdk.core","optional":false}],"imports":[{"symbol":"PublicHostedZone","correct":"from aws_cdk import aws_route53 as route53"},{"symbol":"ARecord","correct":"from aws_cdk import aws_route53 as route53"},{"symbol":"RecordTarget","correct":"from aws_cdk import aws_route53 as route53"},{"symbol":"CnameRecord","correct":"from aws_cdk import aws_route53 as route53"},{"note":"While direct import works, aliasing `aws_route53` to `route53` is the conventional CDK v1 pattern for better readability and consistency.","wrong":"from aws_cdk.aws_route53 import HostedZone","symbol":"HostedZone","correct":"from aws_cdk import aws_route53 as route53"}],"quickstart":{"code":"import os\nfrom aws_cdk import core as cdk\nfrom aws_cdk import aws_route53 as route53\n\n\nclass MyRoute53Stack(cdk.Stack):\n    def __init__(self, scope: cdk.App, id: str, **kwargs) -> None:\n        super().__init__(scope, id, **kwargs)\n\n        # Create a public hosted zone\n        hosted_zone = route53.PublicHostedZone(\n            self, \"MyHostedZone\",\n            zone_name=\"example.com\"\n        )\n\n        # Add an A record pointing to an IP address\n        route53.ARecord(\n            self, \"MyARecord\",\n            zone=hosted_zone,\n            target=route53.RecordTarget.from_ip_addresses(\"192.0.2.1\", \"198.51.100.1\"),\n            record_name=\"www\"\n        )\n\n        # Add a CNAME record\n        route53.CnameRecord(\n            self, \"MyCnameRecord\",\n            zone=hosted_zone,\n            domain_name=\"www.example.com\", # Must be a fully qualified domain name\n            record_name=\"app\"\n        )\n\napp = cdk.App()\nMyRoute53Stack(app, \"MyRoute53Stack\",\n               env=cdk.Environment(account=os.environ.get('CDK_DEFAULT_ACCOUNT', '123456789012'),\n                                   region=os.environ.get('CDK_DEFAULT_REGION', 'us-east-1'))\n               )\napp.synth()","lang":"python","description":"This quickstart demonstrates how to create a public hosted zone and add A and CNAME records using `aws-cdk-aws-route53` within a CDK v1 application."},"warnings":[{"fix":"Migrate your CDK applications to AWS CDK v2. This involves changing import statements from `aws_cdk.aws_route53` to `aws_cdk_lib.aws_route53` and potentially updating construct usage due to API changes and feature flags. Refer to the official CDK v2 migration guide.","message":"AWS CDK v1 (`aws-cdk.aws-route53`) reached its end-of-life on June 1, 2023. While still functional, it no longer receives updates or security patches. All new development should use AWS CDK v2 (`aws-cdk-lib`).","severity":"breaking","affected_versions":"All v1 versions (1.x.x)"},{"fix":"Always use fully qualified domain names (e.g., `example.com.`) in `HostedZoneName` properties and be mindful of trailing dots in `record_name` and `domain_name` for `CnameRecord` and testing assertions.","message":"When defining CNAME records or looking up hosted zones by name, ensure that fully qualified domain names (FQDNs) are used and handle trailing dots consistently. Route 53 often treats names with and without trailing dots as identical but testing frameworks or specific APIs might require a trailing dot for exact matches.","severity":"gotcha","affected_versions":"All v1 versions (1.x.x)"},{"fix":"For complex updates to `RecordSet` properties, particularly routing policies, consider a staged deployment. Review CloudFormation change sets carefully. If `deleteExisting` causes issues (e.g., attempting to delete non-existent records in new regions), manually verify existing records or consider managing the lifecycle outside CDK for critical updates. For cross-account record management, consider `cdk-cross-account-route53`.","message":"Updating Route 53 record sets, especially for changes in routing policies or when using the `deleteExisting` property, can lead to unexpected behavior or require multiple deployment passes due to the underlying CloudFormation custom resource logic.","severity":"gotcha","affected_versions":"All v1 versions (1.x.x)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Validate the `HostedZoneId` value against your AWS Route 53 console. Ensure your AWS credentials are correct and you are deploying to the intended account/region. If using `HostedZone.fromLookup()`, ensure appropriate AWS credentials are available during `cdk synth`.","cause":"The provided hosted zone ID for an `AWS::Route53::RecordSet` resource is incorrect or does not exist in the AWS account where the stack is being deployed.","error":"No hosted zone found with ID: Z1234567XXXXXXXXXX"},{"fix":"Ensure the `HostedZoneName` property includes a trailing period (e.g., `\"domain.com.\"`) and that a hosted zone with that exact name exists in your AWS account. Use `aws route53 list-hosted-zones` to verify.","cause":"CloudFormation cannot identify the hosted zone name defined for the `HostedZoneName` property. This often happens if the domain name is missing a trailing period or doesn't exist.","error":"No hosted zones named \"domain.com\" found"},{"fix":"Ensure the `record_name` or `Name` property in your `RecordSet` construct is a fully qualified domain name that falls within the specified `zone`. For example, if your hosted zone is `example.com.`, a record name could be `a.example.com.`.","cause":"The DNS value provided to the `Name` property of an `AWS::Route53::RecordSet` does not match the associated hosted zone. The `Name` must be a fully qualified domain name.","error":"RRSet with DNS name a.domain.com is not permitted in zone domain-test.com."}]}