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

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

parent b2ffa430
repos: repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform - repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.48.0 rev: v1.50.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate - id: terraform_validate
......
...@@ -54,9 +54,9 @@ No inputs. ...@@ -54,9 +54,9 @@ No inputs.
| Name | Description | | 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_route53_record_fqdn"></a> [route53\_record\_fqdn](#output\_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_name"></a> [route53\_record\_name](#output\_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_route53_zone_name"></a> [route53\_zone\_name](#output\_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_route53_zone_name_servers"></a> [route53\_zone\_name\_servers](#output\_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_zone_id"></a> [route53\_zone\_zone\_id](#output\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
...@@ -44,8 +44,8 @@ module "zones" { ...@@ -44,8 +44,8 @@ module "zones" {
module "records" { module "records" {
source = "../../modules/records" source = "../../modules/records"
zone_name = keys(module.zones.this_route53_zone_zone_id)[0] zone_name = keys(module.zones.route53_zone_zone_id)[0]
# zone_id = module.zones.this_route53_zone_zone_id["terraform-aws-modules-example.com"] # zone_id = module.zones.route53_zone_zone_id["terraform-aws-modules-example.com"]
records = [ records = [
{ {
...@@ -60,16 +60,16 @@ module "records" { ...@@ -60,16 +60,16 @@ module "records" {
name = "s3-bucket" name = "s3-bucket"
type = "A" type = "A"
alias = { alias = {
name = module.s3_bucket.this_s3_bucket_website_domain name = module.s3_bucket.s3_bucket_website_domain
zone_id = module.s3_bucket.this_s3_bucket_hosted_zone_id zone_id = module.s3_bucket.s3_bucket_hosted_zone_id
} }
}, },
{ {
name = "cloudfront" name = "cloudfront"
type = "A" type = "A"
alias = { alias = {
name = module.cloudfront.this_cloudfront_distribution_domain_name name = module.cloudfront.cloudfront_distribution_domain_name
zone_id = module.cloudfront.this_cloudfront_distribution_hosted_zone_id zone_id = module.cloudfront.cloudfront_distribution_hosted_zone_id
} }
}, },
{ {
...@@ -98,8 +98,8 @@ module "records" { ...@@ -98,8 +98,8 @@ module "records" {
set_identifier = "failover-primary" set_identifier = "failover-primary"
health_check_id = aws_route53_health_check.failover.id health_check_id = aws_route53_health_check.failover.id
alias = { alias = {
name = module.cloudfront.this_cloudfront_distribution_domain_name name = module.cloudfront.cloudfront_distribution_domain_name
zone_id = module.cloudfront.this_cloudfront_distribution_hosted_zone_id zone_id = module.cloudfront.cloudfront_distribution_hosted_zone_id
} }
failover_routing_policy = { failover_routing_policy = {
type = "PRIMARY" type = "PRIMARY"
...@@ -110,8 +110,8 @@ module "records" { ...@@ -110,8 +110,8 @@ module "records" {
type = "A" type = "A"
set_identifier = "failover-secondary" set_identifier = "failover-secondary"
alias = { alias = {
name = module.s3_bucket.this_s3_bucket_website_domain name = module.s3_bucket.s3_bucket_website_domain
zone_id = module.s3_bucket.this_s3_bucket_hosted_zone_id zone_id = module.s3_bucket.s3_bucket_hosted_zone_id
} }
failover_routing_policy = { failover_routing_policy = {
type = "SECONDARY" type = "SECONDARY"
...@@ -122,7 +122,7 @@ module "records" { ...@@ -122,7 +122,7 @@ module "records" {
type = "A" type = "A"
set_identifier = "alternative-resource-name" set_identifier = "alternative-resource-name"
alias = { 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" { ...@@ -141,7 +141,7 @@ module "disabled_records" {
######### #########
resource "aws_route53_health_check" "failover" { resource "aws_route53_health_check" "failover" {
fqdn = module.cloudfront.this_cloudfront_distribution_domain_name fqdn = module.cloudfront.cloudfront_distribution_domain_name
port = 443 port = 443
type = "HTTPS" type = "HTTPS"
resource_path = "/index.html" resource_path = "/index.html"
...@@ -168,7 +168,7 @@ module "cloudfront" { ...@@ -168,7 +168,7 @@ module "cloudfront" {
origin = { origin = {
s3_bucket = { 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 # zones
output "this_route53_zone_zone_id" { output "route53_zone_zone_id" {
description = "Zone ID of Route53 zone" 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" 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" description = "Name of Route53 zone"
value = module.zones.this_route53_zone_name value = module.zones.route53_zone_name
} }
# records # records
output "this_route53_record_name" { output "route53_record_name" {
description = "The name of the record" 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" 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. ...@@ -41,6 +41,6 @@ No modules.
| Name | Description | | 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_route53_record_fqdn"></a> [route53\_record\_fqdn](#output\_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_name"></a> [route53\_record\_name](#output\_route53\_record\_name) | The name of the record |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
output "this_route53_record_name" { output "route53_record_name" {
description = "The name of the record" description = "The name of the record"
value = { for k, v in aws_route53_record.this : k => v.name } 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" description = "FQDN built using the zone domain and name"
value = { for k, v in aws_route53_record.this : k => v.fqdn } value = { for k, v in aws_route53_record.this : k => v.fqdn }
} }
...@@ -38,7 +38,7 @@ No modules. ...@@ -38,7 +38,7 @@ No modules.
| Name | Description | | 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_route53_zone_name"></a> [route53\_zone\_name](#output\_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_route53_zone_name_servers"></a> [route53\_zone\_name\_servers](#output\_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_zone_id"></a> [route53\_zone\_zone\_id](#output\_route53\_zone\_zone\_id) | Zone ID of Route53 zone |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
output "this_route53_zone_zone_id" { output "route53_zone_zone_id" {
description = "Zone ID of Route53 zone" description = "Zone ID of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.zone_id } 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" description = "Name servers of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.name_servers } 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" description = "Name of Route53 zone"
value = { for k, v in aws_route53_zone.this : k => v.name } 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