Commit f2a36579 authored by Anton Babenko's avatar Anton Babenko Committed by GitHub

feat: Shorten outputs (removing this_) (#36)

parent b2ffa430
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.48.0
rev: v1.50.0
hooks:
- id: terraform_fmt
- id: terraform_validate
......
......@@ -54,9 +54,9 @@ No inputs.
| Name | Description |
|------|-------------|
| <a name="output_this_route53_record_fqdn"></a> [this\_route53\_record\_fqdn](#output\_this\_route53\_record\_fqdn) | FQDN built using the zone domain and name |
| <a name="output_this_route53_record_name"></a> [this\_route53\_record\_name](#output\_this\_route53\_record\_name) | The name of the record |
| <a name="output_this_route53_zone_name"></a> [this\_route53\_zone\_name](#output\_this\_route53\_zone\_name) | Name of Route53 zone |
| <a name="output_this_route53_zone_name_servers"></a> [this\_route53\_zone\_name\_servers](#output\_this\_route53\_zone\_name\_servers) | Name servers of Route53 zone |
| <a name="output_this_route53_zone_zone_id"></a> [this\_route53\_zone\_zone\_id](#output\_this\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
| <a name="output_route53_record_fqdn"></a> [route53\_record\_fqdn](#output\_route53\_record\_fqdn) | FQDN built using the zone domain and name |
| <a name="output_route53_record_name"></a> [route53\_record\_name](#output\_route53\_record\_name) | The name of the record |
| <a name="output_route53_zone_name"></a> [route53\_zone\_name](#output\_route53\_zone\_name) | Name of Route53 zone |
| <a name="output_route53_zone_name_servers"></a> [route53\_zone\_name\_servers](#output\_route53\_zone\_name\_servers) | Name servers of Route53 zone |
| <a name="output_route53_zone_zone_id"></a> [route53\_zone\_zone\_id](#output\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
......@@ -44,8 +44,8 @@ module "zones" {
module "records" {
source = "../../modules/records"
zone_name = keys(module.zones.this_route53_zone_zone_id)[0]
# zone_id = module.zones.this_route53_zone_zone_id["terraform-aws-modules-example.com"]
zone_name = keys(module.zones.route53_zone_zone_id)[0]
# zone_id = module.zones.route53_zone_zone_id["terraform-aws-modules-example.com"]
records = [
{
......@@ -60,16 +60,16 @@ module "records" {
name = "s3-bucket"
type = "A"
alias = {
name = module.s3_bucket.this_s3_bucket_website_domain
zone_id = module.s3_bucket.this_s3_bucket_hosted_zone_id
name = module.s3_bucket.s3_bucket_website_domain
zone_id = module.s3_bucket.s3_bucket_hosted_zone_id
}
},
{
name = "cloudfront"
type = "A"
alias = {
name = module.cloudfront.this_cloudfront_distribution_domain_name
zone_id = module.cloudfront.this_cloudfront_distribution_hosted_zone_id
name = module.cloudfront.cloudfront_distribution_domain_name
zone_id = module.cloudfront.cloudfront_distribution_hosted_zone_id
}
},
{
......@@ -98,8 +98,8 @@ module "records" {
set_identifier = "failover-primary"
health_check_id = aws_route53_health_check.failover.id
alias = {
name = module.cloudfront.this_cloudfront_distribution_domain_name
zone_id = module.cloudfront.this_cloudfront_distribution_hosted_zone_id
name = module.cloudfront.cloudfront_distribution_domain_name
zone_id = module.cloudfront.cloudfront_distribution_hosted_zone_id
}
failover_routing_policy = {
type = "PRIMARY"
......@@ -110,8 +110,8 @@ module "records" {
type = "A"
set_identifier = "failover-secondary"
alias = {
name = module.s3_bucket.this_s3_bucket_website_domain
zone_id = module.s3_bucket.this_s3_bucket_hosted_zone_id
name = module.s3_bucket.s3_bucket_website_domain
zone_id = module.s3_bucket.s3_bucket_hosted_zone_id
}
failover_routing_policy = {
type = "SECONDARY"
......@@ -122,7 +122,7 @@ module "records" {
type = "A"
set_identifier = "alternative-resource-name"
alias = {
name = module.s3_bucket.this_s3_bucket_website_domain
name = module.s3_bucket.s3_bucket_website_domain
}
}
]
......@@ -141,7 +141,7 @@ module "disabled_records" {
#########
resource "aws_route53_health_check" "failover" {
fqdn = module.cloudfront.this_cloudfront_distribution_domain_name
fqdn = module.cloudfront.cloudfront_distribution_domain_name
port = 443
type = "HTTPS"
resource_path = "/index.html"
......@@ -168,7 +168,7 @@ module "cloudfront" {
origin = {
s3_bucket = {
domain_name = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name
domain_name = module.s3_bucket.s3_bucket_bucket_regional_domain_name
}
}
......
# zones
output "this_route53_zone_zone_id" {
output "route53_zone_zone_id" {
description = "Zone ID of Route53 zone"
value = module.zones.this_route53_zone_zone_id
value = module.zones.route53_zone_zone_id
}
output "this_route53_zone_name_servers" {
output "route53_zone_name_servers" {
description = "Name servers of Route53 zone"
value = module.zones.this_route53_zone_name_servers
value = module.zones.route53_zone_name_servers
}
output "this_route53_zone_name" {
output "route53_zone_name" {
description = "Name of Route53 zone"
value = module.zones.this_route53_zone_name
value = module.zones.route53_zone_name
}
# records
output "this_route53_record_name" {
output "route53_record_name" {
description = "The name of the record"
value = module.records.this_route53_record_name
value = module.records.route53_record_name
}
output "this_route53_record_fqdn" {
output "route53_record_fqdn" {
description = "FQDN built using the zone domain and name"
value = module.records.this_route53_record_fqdn
value = module.records.route53_record_fqdn
}
......@@ -41,6 +41,6 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_this_route53_record_fqdn"></a> [this\_route53\_record\_fqdn](#output\_this\_route53\_record\_fqdn) | FQDN built using the zone domain and name |
| <a name="output_this_route53_record_name"></a> [this\_route53\_record\_name](#output\_this\_route53\_record\_name) | The name of the record |
| <a name="output_route53_record_fqdn"></a> [route53\_record\_fqdn](#output\_route53\_record\_fqdn) | FQDN built using the zone domain and name |
| <a name="output_route53_record_name"></a> [route53\_record\_name](#output\_route53\_record\_name) | The name of the record |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
output "this_route53_record_name" {
output "route53_record_name" {
description = "The name of the record"
value = { for k, v in aws_route53_record.this : k => v.name }
}
output "this_route53_record_fqdn" {
output "route53_record_fqdn" {
description = "FQDN built using the zone domain and name"
value = { for k, v in aws_route53_record.this : k => v.fqdn }
}
......@@ -38,7 +38,7 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_this_route53_zone_name"></a> [this\_route53\_zone\_name](#output\_this\_route53\_zone\_name) | Name of Route53 zone |
| <a name="output_this_route53_zone_name_servers"></a> [this\_route53\_zone\_name\_servers](#output\_this\_route53\_zone\_name\_servers) | Name servers of Route53 zone |
| <a name="output_this_route53_zone_zone_id"></a> [this\_route53\_zone\_zone\_id](#output\_this\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
| <a name="output_route53_zone_name"></a> [route53\_zone\_name](#output\_route53\_zone\_name) | Name of Route53 zone |
| <a name="output_route53_zone_name_servers"></a> [route53\_zone\_name\_servers](#output\_route53\_zone\_name\_servers) | Name servers of Route53 zone |
| <a name="output_route53_zone_zone_id"></a> [route53\_zone\_zone\_id](#output\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
output "this_route53_zone_zone_id" {
output "route53_zone_zone_id" {
description = "Zone ID of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.zone_id }
}
output "this_route53_zone_name_servers" {
output "route53_zone_name_servers" {
description = "Name servers of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.name_servers }
}
output "this_route53_zone_name" {
output "route53_zone_name" {
description = "Name of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.name }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment