# terraform-route-53-delegated-subdomain
**Repository Path**: mirrors_thoughtbot/terraform-route-53-delegated-subdomain
## Basic Information
- **Project Name**: terraform-route-53-delegated-subdomain
- **Description**: Delegate subdomains in Route 53 to other hosted zones, including across accounts
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-08-25
- **Last Updated**: 2026-04-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Route 53 Delegated Subdomain Terraform Module
Creates a Route 53 hosted zone for a subdomain delegated from another hosted
zone. You can use this module to create restricted hosted zones for specific
environments, or to allow another account to manage record sets for a specific
subdomain.
## Example
```
terraform {
backend "s3" {}
required_providers {
aws = {
version = "~> 3.0"
}
}
}
provider "aws" {
alias = "network"
region = "us-west-2"
}
provider "aws" {
region = "us-west-2"
alias = "staging"
}
module "subdomain" {
source = "git@github.com:thoughtbot/terraform-route-53-delegated-subdomain.git?ref=v0.3.0"
providers = {
aws.root = aws.network
aws.subdomain = aws.staging
}
root_domain_name = "example.com"
subdomain = "staging"
}
```
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0.0 |
| [aws](#requirement\_aws) | ~> 5.0 |
## Providers
| Name | Version |
|------|---------|
| [aws.root](#provider\_aws.root) | ~> 5.0 |
| [aws.subdomain](#provider\_aws.subdomain) | ~> 5.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_route53_record.ns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_zone.subdomain](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource |
| [aws_route53_zone.root](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [root\_domain\_name](#input\_root\_domain\_name) | Domain name (ie example.com) for the root hosted zone | `string` | n/a | yes |
| [subdomain](#input\_subdomain) | Subdomain (ie www) for which a hosted zone should be delegated | `string` | n/a | yes |
| [tags](#input\_tags) | Tags which should be applied to created resources | `map(string)` | `{}` | no |
| [ttl](#input\_ttl) | TTL value for NS DNS records | `number` | `3600` | no |
## Outputs
| Name | Description |
|------|-------------|
| [name](#output\_name) | Full name of the subdomain |
| [subdomain\_zone\_id](#output\_subdomain\_zone\_id) | Zone ID of the subdomain hosted zone |
## Contributing
Please see [CONTRIBUTING.md](./CONTRIBUTING.md).
## License
This module is Copyright © 2021 Joe Ferris and thoughtbot. It is free
software, and may be redistributed under the terms specified in the [LICENSE]
file.
[LICENSE]: ./LICENSE
## About thoughtbot

This repo is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software!
See [our other projects][community].
We are [available for hire][hire].
[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github