From 8b778ce67d9d14cb03a669d3e4b33db9fbf6eadb Mon Sep 17 00:00:00 2001 From: gar Date: Thu, 7 Oct 2021 11:13:46 -0700 Subject: [PATCH] Adding route53 hosted zone --- .../aws/dev/5-route53-hostedzone/main.tf | 42 +++++++++++++++++++ .../aws/dev/5-route53-hostedzone/outputs.tf | 9 ++++ 2 files changed, 51 insertions(+) create mode 100644 terraform-environments/aws/dev/5-route53-hostedzone/main.tf create mode 100644 terraform-environments/aws/dev/5-route53-hostedzone/outputs.tf diff --git a/terraform-environments/aws/dev/5-route53-hostedzone/main.tf b/terraform-environments/aws/dev/5-route53-hostedzone/main.tf new file mode 100644 index 000000000..a37f13d10 --- /dev/null +++ b/terraform-environments/aws/dev/5-route53-hostedzone/main.tf @@ -0,0 +1,42 @@ +locals { + aws_region = "us-east-1" + domain_name = "dev.k8s.managedkube.com" + tags = { + ops_env = "dev" + ops_managed_by = "terraform", + ops_source_repo = "kubernetes-ops", + ops_source_repo_path = "terraform-environments/aws/dev/5-route53-hostedzone", + ops_owners = "devops", + } +} + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.37.0" + } + } + + backend "remote" { + organization = "managedkube" + + workspaces { + name = "kubernetes-ops-dev-5-route53-hostedzone" + } + } +} + +provider "aws" { + region = local.aws_region +} + +# +# Route53 Hosted Zone +# +module "route53-hostedzone" { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/aws/route53/hosted-zone?ref=v1.0.19" + + domain_name = local.domain_name + tags = local.tags +} diff --git a/terraform-environments/aws/dev/5-route53-hostedzone/outputs.tf b/terraform-environments/aws/dev/5-route53-hostedzone/outputs.tf new file mode 100644 index 000000000..42738c672 --- /dev/null +++ b/terraform-environments/aws/dev/5-route53-hostedzone/outputs.tf @@ -0,0 +1,9 @@ +output "zone_id" { + description = "The hosted zone ID" + value = module.route53-hostedzone.zone_id +} + +output "name_servers" { + description = "The hosted zone name servers" + value = module.route53-hostedzone.name_servers +}