github.com/telepresenceio/telepresence/v2@v2.20.0-pro.6.0.20240517030216-236ea954e789/test-infra/aws-okd/dns/dns.tf (about)

     1  variable "parent_domain" {
     2    type        = string
     3    description = "The name of the parent domain"
     4  }
     5  
     6  variable "child_subdomain" {
     7    type        = string
     8    description = "The name of the child domain"
     9  }
    10  
    11  variable "child_subdomain_comment" {
    12    type        = string
    13    description = "The comment of the child domain"
    14  }
    15  
    16  variable "aws_region" {
    17    type        = string
    18    description = "The region to create the resources in"
    19  }
    20  
    21  terraform {
    22    required_providers {
    23      aws = {
    24        source  = "hashicorp/aws",
    25        version = "~> 3.20"
    26      }
    27    }
    28  }
    29  
    30  provider "aws" {
    31    region = var.aws_region
    32  }
    33  
    34  data "aws_route53_zone" "parent_dns_zone" {
    35    name = var.parent_domain
    36  }
    37  
    38  
    39  resource "aws_route53_zone" "child_dns_zone" {
    40    name    = "${var.child_subdomain}.${data.aws_route53_zone.parent_dns_zone.name}"
    41    comment = var.child_subdomain_comment
    42  }
    43  
    44  resource "aws_route53_record" "child_dns_route" {
    45    zone_id = data.aws_route53_zone.parent_dns_zone.id
    46    name    = var.child_subdomain
    47    type    = "NS"
    48    ttl     = 3600
    49    records = aws_route53_zone.child_dns_zone.name_servers
    50  }