From 78246574f64ce5d6fd23b0d5e7a843fdee376dd1 Mon Sep 17 00:00:00 2001 From: badra001 Date: Thu, 6 Apr 2023 16:16:07 -0400 Subject: [PATCH] fix docs --- a/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ a/main.tf | 2 +- aaaa/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ aaaa/main.tf | 2 +- cname/README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ cname/main.tf | 2 +- host/README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ host/main.tf | 2 +- ptr/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ ptr/main.tf | 2 +- 10 files changed, 247 insertions(+), 5 deletions(-) diff --git a/a/README.md b/a/README.md index c9511c5..616e4d9 100644 --- a/a/README.md +++ b/a/README.md @@ -60,6 +60,55 @@ module "dms_replication_dns" { } ``` +## Using DHCP options data resource + +data "aws\_vpc\_dhcp\_options" "options" { + filter { + name = "vpc-id" + values = [local.vpc\_id] + } +} + +```hcl +module "dms_replication_dns" { + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//host" + + name = format("%v.%v", aws_dms_replication_instance.dev.replication_instance_id, data.aws_vpc_dhc_options.options.domain_name) + values = aws_dms_replication_instance.dev.replication_instance_private_ips +} +``` + +## Using a Zone defined in another account +This requires the role `r-inf-terraform-route53` be created from the Terraform module `aws-vpc-setup/route53-association/terraform-role` +(generally in `common/apps/route53`. It then uses an STS AssumeRole from Terraform. You must have the approriate permissions +on the source account to assume this role. + +file: provider.route53.east\_ma13\_gov.tf +```hcl +provider "aws" { + alias = "east_ma13_gov" + region = var.region_map["east"] + assume_role { + role_arn = format("arn:%v:iam::%v:role/r-inf-terraform-route53", data.aws_arn.current.partition, "187944776148") + session_name = var.os_username + } +} +``` + +file: dns.tf +```hcl +module "db_cname" { + providers = { + aws = aws.east_ma13_gov + } + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + + zone = var.vpc_domain_name + name = local.app_db_dns_name + values = [module.db.db_instance_address] +} +``` + ## Requirements | Name | Version | diff --git a/a/main.tf b/a/main.tf index 3fc10a7..8664327 100644 --- a/a/main.tf +++ b/a/main.tf @@ -61,7 +61,7 @@ * } * ``` * -# ## Using DHCP options data resource +* ## Using DHCP options data resource * * data "aws_vpc_dhcp_options" "options" { * filter { diff --git a/aaaa/README.md b/aaaa/README.md index 892ac6d..f4f0bf7 100644 --- a/aaaa/README.md +++ b/aaaa/README.md @@ -60,6 +60,55 @@ module "dms_replication_dns" { } ``` +## Using DHCP options data resource + +```hcl +data "aws_vpc_dhcp_options" "options" { + filter { + name = "vpc-id" + values = [local.vpc_id] + } +} + +module "dms_replication_dns" { + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//aaaa" + + name = format("%v.%v", aws_dms_replication_instance.dev.replication_instance_id, data.aws_vpc_dhc_options.options.domain_name) + values = aws_dms_replication_instance.dev.replication_instance_private_ips +} +``` + +## Using a Zone defined in another account +This requires the role `r-inf-terraform-route53` be created from the Terraform module `aws-vpc-setup/route53-association/terraform-role` +(generally in `common/apps/route53`. It then uses an STS AssumeRole from Terraform. You must have the approriate permissions +on the source account to assume this role. + +file: provider.route53.east\_ma13\_gov.tf +```hcl +provider "aws" { + alias = "east_ma13_gov" + region = var.region_map["east"] + assume_role { + role_arn = format("arn:%v:iam::%v:role/r-inf-terraform-route53", data.aws_arn.current.partition, "187944776148") + session_name = var.os_username + } +} +``` + +file: dns.tf +```hcl +module "db_cname" { + providers = { + aws = aws.east_ma13_gov + } + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + + zone = var.vpc_domain_name + name = local.app_db_dns_name + values = [module.db.db_instance_address] +} +``` + ## Requirements | Name | Version | diff --git a/aaaa/main.tf b/aaaa/main.tf index f49c328..5d17e63 100644 --- a/aaaa/main.tf +++ b/aaaa/main.tf @@ -61,7 +61,7 @@ * } * ``` * -# ## Using DHCP options data resource +* ## Using DHCP options data resource * * ```hcl * data "aws_vpc_dhcp_options" "options" { diff --git a/cname/README.md b/cname/README.md index 5039348..26217cc 100644 --- a/cname/README.md +++ b/cname/README.md @@ -62,6 +62,53 @@ module "lakefront_cname" { } ``` +## Using DHCP options data resource + +data "aws\_vpc\_dhcp\_options" "options" { + filter { + name = "vpc-id" + values = [local.vpc\_id] + } +} + +module "stat\_cname" +{ + source  = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + name    = format("%v.%v","stat",data.aws\_vpc\_dhc\_options.options.domain\_name) + values  = aws\_lb.adsd\_dapps\_dev\_stat\_lb.dns\_name +} +``` + +## Using a Zone defined in another account +This requires the role `r-inf-terraform-route53` be created from the Terraform module `aws-vpc-setup/route53-association/terraform-role` +(generally in `common/apps/route53`. It then uses an STS AssumeRole from Terraform. You must have the approriate permissions +on the source account to assume this role. + +file: provider.route53.east_ma13_gov.tf +```hcl +provider "aws" { + alias = "east\_ma13\_gov" + region = var.region\_map["east"] + assume\_role { + role\_arn = format("arn:%v:iam::%v:role/r-inf-terraform-route53", data.aws\_arn.current.partition, "187944776148") + session\_name = var.os\_username + } +} +``` + +file: dns.tf +```hcl +module "db\_cname" { + providers = { + aws = aws.east\_ma13\_gov + } + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + + zone = var.vpc\_domain\_name + name = local.app\_db\_dns\_name + values = [module.db.db\_instance\_address] +} + ## Requirements | Name | Version | diff --git a/cname/main.tf b/cname/main.tf index 4074586..395c199 100644 --- a/cname/main.tf +++ b/cname/main.tf @@ -63,7 +63,7 @@ * } * ``` * -# ## Using DHCP options data resource +* ## Using DHCP options data resource * * data "aws_vpc_dhcp_options" "options" { * filter { diff --git a/host/README.md b/host/README.md index 5b8f9ea..f0195bd 100644 --- a/host/README.md +++ b/host/README.md @@ -60,6 +60,54 @@ module "dms_replication_dns" { } ``` +## Using DHCP options data resource + +```hcl +data "aws_vpc_dhcp_options" "options" { + filter { + name = "vpc-id" + values = [local.vpc_id] + } +} + +module "dms_replication_dns" { + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//host" + + name = format("%v.%v", aws_dms_replication_instance.dev.replication_instance_id, data.aws_vpc_dhc_options.options.domain_name) + values = aws_dms_replication_instance.dev.replication_instance_private_ips +} +``` +## Using a Zone defined in another account +This requires the role `r-inf-terraform-route53` be created from the Terraform module `aws-vpc-setup/route53-association/terraform-role` +(generally in `common/apps/route53`. It then uses an STS AssumeRole from Terraform. You must have the approriate permissions +on the source account to assume this role. + +file: provider.route53.east\_ma13\_gov.tf +```hcl +provider "aws" { + alias = "east_ma13_gov" + region = var.region_map["east"] + assume_role { + role_arn = format("arn:%v:iam::%v:role/r-inf-terraform-route53", data.aws_arn.current.partition, "187944776148") + session_name = var.os_username + } +} +``` + +file: dns.tf +```hcl +module "db_cname" { + providers = { + aws = aws.east_ma13_gov + } + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + + zone = var.vpc_domain_name + name = local.app_db_dns_name + values = [module.db.db_instance_address] +} +``` + ## Requirements | Name | Version | diff --git a/host/main.tf b/host/main.tf index 45821a4..ccd1fd9 100644 --- a/host/main.tf +++ b/host/main.tf @@ -61,7 +61,7 @@ * } * ``` * -# ## Using DHCP options data resource +* ## Using DHCP options data resource * * ```hcl * data "aws_vpc_dhcp_options" "options" { diff --git a/ptr/README.md b/ptr/README.md index beb3327..4e7493e 100644 --- a/ptr/README.md +++ b/ptr/README.md @@ -56,6 +56,55 @@ module "dms_replication_dns" { } ``` +## Using DHCP options data resource + +```hcl +data "aws_vpc_dhcp_options" "options" { + filter { + name = "vpc-id" + values = [local.vpc_id] + } +} + +module "dms_replication_dns" { + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//ptr" + + name = format("%v.%v", aws_dms_replication_instance.dev.replication_instance_id, data.aws_vpc_dhc_options.options.domain_name) + values = aws_dms_replication_instance.dev.replication_instance_private_ips +} +``` + +## Using a Zone defined in another account +This requires the role `r-inf-terraform-route53` be created from the Terraform module `aws-vpc-setup/route53-association/terraform-role` +(generally in `common/apps/route53`. It then uses an STS AssumeRole from Terraform. You must have the approriate permissions +on the source account to assume this role. + +file: provider.route53.east\_ma13\_gov.tf +```hcl +provider "aws" { + alias = "east_ma13_gov" + region = var.region_map["east"] + assume_role { + role_arn = format("arn:%v:iam::%v:role/r-inf-terraform-route53", data.aws_arn.current.partition, "187944776148") + session_name = var.os_username + } +} +``` + +file: dns.tf +```hcl +module "db_cname" { + providers = { + aws = aws.east_ma13_gov + } + source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname" + + zone = var.vpc_domain_name + name = local.app_db_dns_name + values = [module.db.db_instance_address] +} +``` + ## Requirements | Name | Version | diff --git a/ptr/main.tf b/ptr/main.tf index 0d1102d..49821a5 100644 --- a/ptr/main.tf +++ b/ptr/main.tf @@ -57,7 +57,7 @@ * } * ``` * -# ## Using DHCP options data resource +* ## Using DHCP options data resource * * ```hcl * data "aws_vpc_dhcp_options" "options" {