From 30f0cdabeb8e1351895ad98427b5a675bcb5ca3e Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Mon, 26 Apr 2021 18:55:17 +0200 Subject: [PATCH] feat: Shorten outputs (removing this_) --- .pre-commit-config.yaml | 2 +- README.md | 16 +++++++-------- examples/complete/README.md | 16 +++++++-------- examples/complete/main.tf | 2 +- examples/complete/outputs.tf | 32 +++++++++++++++--------------- examples/notification/README.md | 17 ++++++++-------- examples/notification/main.tf | 13 +++--------- examples/notification/outputs.tf | 32 +++++++++++++++--------------- examples/object/README.md | 10 +++++----- examples/object/main.tf | 6 +++--- examples/object/outputs.tf | 20 +++++++++---------- examples/s3-replication/README.md | 16 +++++++-------- examples/s3-replication/outputs.tf | 32 +++++++++++++++--------------- modules/notification/README.md | 2 +- modules/notification/outputs.tf | 2 +- modules/object/README.md | 6 +++--- modules/object/outputs.tf | 6 +++--- outputs.tf | 16 +++++++-------- 18 files changed, 119 insertions(+), 127 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8814cf61..6dda8931 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.48.0 + rev: v1.50.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/README.md b/README.md index 5f0678d4..7afc3f04 100644 --- a/README.md +++ b/README.md @@ -158,14 +158,14 @@ No modules. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | -| [this\_s3\_bucket\_bucket\_domain\_name](#output\_this\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | -| [this\_s3\_bucket\_bucket\_regional\_domain\_name](#output\_this\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | -| [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | -| [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. | -| [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. | -| [this\_s3\_bucket\_website\_domain](#output\_this\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | -| [this\_s3\_bucket\_website\_endpoint](#output\_this\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | +| [s3\_bucket\_bucket\_regional\_domain\_name](#output\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | +| [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. | +| [s3\_bucket\_website\_domain](#output\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | +| [s3\_bucket\_website\_endpoint](#output\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | ## Authors diff --git a/examples/complete/README.md b/examples/complete/README.md index a59407dd..5f390f9e 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -66,12 +66,12 @@ No inputs. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | -| [this\_s3\_bucket\_bucket\_domain\_name](#output\_this\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | -| [this\_s3\_bucket\_bucket\_regional\_domain\_name](#output\_this\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | -| [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | -| [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. | -| [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. | -| [this\_s3\_bucket\_website\_domain](#output\_this\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | -| [this\_s3\_bucket\_website\_endpoint](#output\_this\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | +| [s3\_bucket\_bucket\_regional\_domain\_name](#output\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | +| [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. | +| [s3\_bucket\_website\_domain](#output\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | +| [s3\_bucket\_website\_endpoint](#output\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 587a19c2..45f16cbe 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -112,7 +112,7 @@ module "s3_bucket" { } logging = { - target_bucket = module.log_bucket.this_s3_bucket_id + target_bucket = module.log_bucket.s3_bucket_id target_prefix = "log/" } diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index d7a44021..3c66187e 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -1,39 +1,39 @@ -output "this_s3_bucket_id" { +output "s3_bucket_id" { description = "The name of the bucket." - value = module.s3_bucket.this_s3_bucket_id + value = module.s3_bucket.s3_bucket_id } -output "this_s3_bucket_arn" { +output "s3_bucket_arn" { description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." - value = module.s3_bucket.this_s3_bucket_arn + value = module.s3_bucket.s3_bucket_arn } -output "this_s3_bucket_bucket_domain_name" { +output "s3_bucket_bucket_domain_name" { description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com." - value = module.s3_bucket.this_s3_bucket_bucket_domain_name + value = module.s3_bucket.s3_bucket_bucket_domain_name } -output "this_s3_bucket_bucket_regional_domain_name" { +output "s3_bucket_bucket_regional_domain_name" { description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL." - value = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name + value = module.s3_bucket.s3_bucket_bucket_regional_domain_name } -output "this_s3_bucket_hosted_zone_id" { +output "s3_bucket_hosted_zone_id" { description = "The Route 53 Hosted Zone ID for this bucket's region." - value = module.s3_bucket.this_s3_bucket_hosted_zone_id + value = module.s3_bucket.s3_bucket_hosted_zone_id } -output "this_s3_bucket_region" { +output "s3_bucket_region" { description = "The AWS region this bucket resides in." - value = module.s3_bucket.this_s3_bucket_region + value = module.s3_bucket.s3_bucket_region } -output "this_s3_bucket_website_endpoint" { +output "s3_bucket_website_endpoint" { description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string." - value = module.s3_bucket.this_s3_bucket_website_endpoint + value = module.s3_bucket.s3_bucket_website_endpoint } -output "this_s3_bucket_website_domain" { +output "s3_bucket_website_domain" { description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. " - value = module.s3_bucket.this_s3_bucket_website_domain + value = module.s3_bucket.s3_bucket_website_domain } diff --git a/examples/notification/README.md b/examples/notification/README.md index c3675cb7..0cf7f5e7 100644 --- a/examples/notification/README.md +++ b/examples/notification/README.md @@ -52,7 +52,6 @@ Note that this example may create resources which cost money. Run `terraform des | [null_resource.download_package](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource | | [aws_iam_policy_document.sqs_external](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [null_data_source.downloaded_package](https://registry.terraform.io/providers/hashicorp/null/latest/docs/data-sources/data_source) | data source | ## Inputs @@ -62,12 +61,12 @@ No inputs. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | -| [this\_s3\_bucket\_bucket\_domain\_name](#output\_this\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | -| [this\_s3\_bucket\_bucket\_regional\_domain\_name](#output\_this\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | -| [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | -| [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. | -| [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. | -| [this\_s3\_bucket\_website\_domain](#output\_this\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | -| [this\_s3\_bucket\_website\_endpoint](#output\_this\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | +| [s3\_bucket\_bucket\_regional\_domain\_name](#output\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | +| [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. | +| [s3\_bucket\_website\_domain](#output\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | +| [s3\_bucket\_website\_endpoint](#output\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | diff --git a/examples/notification/main.tf b/examples/notification/main.tf index 71b72186..f6e221f7 100644 --- a/examples/notification/main.tf +++ b/examples/notification/main.tf @@ -32,13 +32,6 @@ resource "null_resource" "download_package" { } } -data "null_data_source" "downloaded_package" { - inputs = { - id = null_resource.download_package.id - filename = local.downloaded - } -} - module "lambda_function1" { source = "terraform-aws-modules/lambda/aws" version = "~> 1.0" @@ -48,7 +41,7 @@ module "lambda_function1" { runtime = "python3.8" create_package = false - local_existing_package = data.null_data_source.downloaded_package.outputs["filename"] + local_existing_package = local.downloaded } module "lambda_function2" { @@ -60,7 +53,7 @@ module "lambda_function2" { runtime = "python3.8" create_package = false - local_existing_package = data.null_data_source.downloaded_package.outputs["filename"] + local_existing_package = local.downloaded } module "sns_topic1" { @@ -99,7 +92,7 @@ resource "aws_sqs_queue_policy" "allow_external" { module "all_notifications" { source = "../../modules/notification" - bucket = module.s3_bucket.this_s3_bucket_id + bucket = module.s3_bucket.s3_bucket_id # Common error - Error putting S3 notification configuration: InvalidArgument: Configuration is ambiguously defined. Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type. diff --git a/examples/notification/outputs.tf b/examples/notification/outputs.tf index d7a44021..3c66187e 100644 --- a/examples/notification/outputs.tf +++ b/examples/notification/outputs.tf @@ -1,39 +1,39 @@ -output "this_s3_bucket_id" { +output "s3_bucket_id" { description = "The name of the bucket." - value = module.s3_bucket.this_s3_bucket_id + value = module.s3_bucket.s3_bucket_id } -output "this_s3_bucket_arn" { +output "s3_bucket_arn" { description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." - value = module.s3_bucket.this_s3_bucket_arn + value = module.s3_bucket.s3_bucket_arn } -output "this_s3_bucket_bucket_domain_name" { +output "s3_bucket_bucket_domain_name" { description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com." - value = module.s3_bucket.this_s3_bucket_bucket_domain_name + value = module.s3_bucket.s3_bucket_bucket_domain_name } -output "this_s3_bucket_bucket_regional_domain_name" { +output "s3_bucket_bucket_regional_domain_name" { description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL." - value = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name + value = module.s3_bucket.s3_bucket_bucket_regional_domain_name } -output "this_s3_bucket_hosted_zone_id" { +output "s3_bucket_hosted_zone_id" { description = "The Route 53 Hosted Zone ID for this bucket's region." - value = module.s3_bucket.this_s3_bucket_hosted_zone_id + value = module.s3_bucket.s3_bucket_hosted_zone_id } -output "this_s3_bucket_region" { +output "s3_bucket_region" { description = "The AWS region this bucket resides in." - value = module.s3_bucket.this_s3_bucket_region + value = module.s3_bucket.s3_bucket_region } -output "this_s3_bucket_website_endpoint" { +output "s3_bucket_website_endpoint" { description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string." - value = module.s3_bucket.this_s3_bucket_website_endpoint + value = module.s3_bucket.s3_bucket_website_endpoint } -output "this_s3_bucket_website_domain" { +output "s3_bucket_website_domain" { description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. " - value = module.s3_bucket.this_s3_bucket_website_domain + value = module.s3_bucket.s3_bucket_website_domain } diff --git a/examples/object/README.md b/examples/object/README.md index 6d1bf1c0..fe4192c0 100644 --- a/examples/object/README.md +++ b/examples/object/README.md @@ -55,9 +55,9 @@ No inputs. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | -| [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. | -| [this\_s3\_bucket\_object\_etag](#output\_this\_s3\_bucket\_object\_etag) | The ETag generated for the object (an MD5 sum of the object content). | -| [this\_s3\_bucket\_object\_id](#output\_this\_s3\_bucket\_object\_id) | The key of S3 object | -| [this\_s3\_bucket\_object\_version\_id](#output\_this\_s3\_bucket\_object\_version\_id) | A unique version ID value for the object, if bucket versioning is enabled. | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_object\_etag](#output\_s3\_bucket\_object\_etag) | The ETag generated for the object (an MD5 sum of the object content). | +| [s3\_bucket\_object\_id](#output\_s3\_bucket\_object\_id) | The key of S3 object | +| [s3\_bucket\_object\_version\_id](#output\_s3\_bucket\_object\_version\_id) | A unique version ID value for the object, if bucket versioning is enabled. | diff --git a/examples/object/main.tf b/examples/object/main.tf index 129821cf..b0fdc156 100644 --- a/examples/object/main.tf +++ b/examples/object/main.tf @@ -12,7 +12,7 @@ provider "aws" { module "object" { source = "../../modules/object" - bucket = module.s3_bucket.this_s3_bucket_id + bucket = module.s3_bucket.s3_bucket_id key = "${random_pet.this.id}-local" file_source = "README.md" @@ -26,7 +26,7 @@ module "object" { module "object_complete" { source = "../../modules/object" - bucket = module.s3_bucket.this_s3_bucket_id + bucket = module.s3_bucket.s3_bucket_id key = "${random_pet.this.id}-complete" content = jsonencode({ data : "value" }) @@ -54,7 +54,7 @@ module "object_complete" { module "object_locked" { source = "../../modules/object" - bucket = module.s3_bucket_with_object_lock.this_s3_bucket_id + bucket = module.s3_bucket_with_object_lock.s3_bucket_id key = "${random_pet.this.id}-locked" content = "some-content-locked-by-governance" diff --git a/examples/object/outputs.tf b/examples/object/outputs.tf index ea4d2773..223539bd 100644 --- a/examples/object/outputs.tf +++ b/examples/object/outputs.tf @@ -1,26 +1,26 @@ # S3 object -output "this_s3_bucket_object_id" { +output "s3_bucket_object_id" { description = "The key of S3 object" - value = module.object.this_s3_bucket_object_id + value = module.object.s3_bucket_object_id } -output "this_s3_bucket_object_etag" { +output "s3_bucket_object_etag" { description = "The ETag generated for the object (an MD5 sum of the object content)." - value = module.object.this_s3_bucket_object_etag + value = module.object.s3_bucket_object_etag } -output "this_s3_bucket_object_version_id" { +output "s3_bucket_object_version_id" { description = "A unique version ID value for the object, if bucket versioning is enabled." - value = module.object.this_s3_bucket_object_version_id + value = module.object.s3_bucket_object_version_id } # S3 bucket -output "this_s3_bucket_id" { +output "s3_bucket_id" { description = "The name of the bucket." - value = module.s3_bucket.this_s3_bucket_id + value = module.s3_bucket.s3_bucket_id } -output "this_s3_bucket_arn" { +output "s3_bucket_arn" { description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." - value = module.s3_bucket.this_s3_bucket_arn + value = module.s3_bucket.s3_bucket_arn } diff --git a/examples/s3-replication/README.md b/examples/s3-replication/README.md index 8dd14cdd..2a0365fe 100644 --- a/examples/s3-replication/README.md +++ b/examples/s3-replication/README.md @@ -59,12 +59,12 @@ No inputs. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | -| [this\_s3\_bucket\_bucket\_domain\_name](#output\_this\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | -| [this\_s3\_bucket\_bucket\_regional\_domain\_name](#output\_this\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | -| [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | -| [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. | -| [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. | -| [this\_s3\_bucket\_website\_domain](#output\_this\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | -| [this\_s3\_bucket\_website\_endpoint](#output\_this\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. | +| [s3\_bucket\_bucket\_regional\_domain\_name](#output\_s3\_bucket\_bucket\_regional\_domain\_name) | The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL. | +| [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. | +| [s3\_bucket\_website\_domain](#output\_s3\_bucket\_website\_domain) | The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. | +| [s3\_bucket\_website\_endpoint](#output\_s3\_bucket\_website\_endpoint) | The website endpoint, if the bucket is configured with a website. If not, this will be an empty string. | diff --git a/examples/s3-replication/outputs.tf b/examples/s3-replication/outputs.tf index d7a44021..3c66187e 100644 --- a/examples/s3-replication/outputs.tf +++ b/examples/s3-replication/outputs.tf @@ -1,39 +1,39 @@ -output "this_s3_bucket_id" { +output "s3_bucket_id" { description = "The name of the bucket." - value = module.s3_bucket.this_s3_bucket_id + value = module.s3_bucket.s3_bucket_id } -output "this_s3_bucket_arn" { +output "s3_bucket_arn" { description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." - value = module.s3_bucket.this_s3_bucket_arn + value = module.s3_bucket.s3_bucket_arn } -output "this_s3_bucket_bucket_domain_name" { +output "s3_bucket_bucket_domain_name" { description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com." - value = module.s3_bucket.this_s3_bucket_bucket_domain_name + value = module.s3_bucket.s3_bucket_bucket_domain_name } -output "this_s3_bucket_bucket_regional_domain_name" { +output "s3_bucket_bucket_regional_domain_name" { description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL." - value = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name + value = module.s3_bucket.s3_bucket_bucket_regional_domain_name } -output "this_s3_bucket_hosted_zone_id" { +output "s3_bucket_hosted_zone_id" { description = "The Route 53 Hosted Zone ID for this bucket's region." - value = module.s3_bucket.this_s3_bucket_hosted_zone_id + value = module.s3_bucket.s3_bucket_hosted_zone_id } -output "this_s3_bucket_region" { +output "s3_bucket_region" { description = "The AWS region this bucket resides in." - value = module.s3_bucket.this_s3_bucket_region + value = module.s3_bucket.s3_bucket_region } -output "this_s3_bucket_website_endpoint" { +output "s3_bucket_website_endpoint" { description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string." - value = module.s3_bucket.this_s3_bucket_website_endpoint + value = module.s3_bucket.s3_bucket_website_endpoint } -output "this_s3_bucket_website_domain" { +output "s3_bucket_website_domain" { description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. " - value = module.s3_bucket.this_s3_bucket_website_domain + value = module.s3_bucket.s3_bucket_website_domain } diff --git a/modules/notification/README.md b/modules/notification/README.md index c85eeae1..836c86de 100644 --- a/modules/notification/README.md +++ b/modules/notification/README.md @@ -49,5 +49,5 @@ No modules. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_notification\_id](#output\_this\_s3\_bucket\_notification\_id) | ID of S3 bucket | +| [s3\_bucket\_notification\_id](#output\_s3\_bucket\_notification\_id) | ID of S3 bucket | diff --git a/modules/notification/outputs.tf b/modules/notification/outputs.tf index 2c38f9da..6086a9e7 100644 --- a/modules/notification/outputs.tf +++ b/modules/notification/outputs.tf @@ -1,4 +1,4 @@ -output "this_s3_bucket_notification_id" { +output "s3_bucket_notification_id" { description = "ID of S3 bucket" value = element(concat(aws_s3_bucket_notification.this.*.id, [""]), 0) } diff --git a/modules/object/README.md b/modules/object/README.md index 1a777f40..79a72a0d 100644 --- a/modules/object/README.md +++ b/modules/object/README.md @@ -58,7 +58,7 @@ No modules. | Name | Description | |------|-------------| -| [this\_s3\_bucket\_object\_etag](#output\_this\_s3\_bucket\_object\_etag) | The ETag generated for the object (an MD5 sum of the object content). | -| [this\_s3\_bucket\_object\_id](#output\_this\_s3\_bucket\_object\_id) | The key of S3 object | -| [this\_s3\_bucket\_object\_version\_id](#output\_this\_s3\_bucket\_object\_version\_id) | A unique version ID value for the object, if bucket versioning is enabled. | +| [s3\_bucket\_object\_etag](#output\_s3\_bucket\_object\_etag) | The ETag generated for the object (an MD5 sum of the object content). | +| [s3\_bucket\_object\_id](#output\_s3\_bucket\_object\_id) | The key of S3 object | +| [s3\_bucket\_object\_version\_id](#output\_s3\_bucket\_object\_version\_id) | A unique version ID value for the object, if bucket versioning is enabled. | diff --git a/modules/object/outputs.tf b/modules/object/outputs.tf index 45231d60..c5075ade 100644 --- a/modules/object/outputs.tf +++ b/modules/object/outputs.tf @@ -1,14 +1,14 @@ -output "this_s3_bucket_object_id" { +output "s3_bucket_object_id" { description = "The key of S3 object" value = element(concat(aws_s3_bucket_object.this.*.id, [""]), 0) } -output "this_s3_bucket_object_etag" { +output "s3_bucket_object_etag" { description = "The ETag generated for the object (an MD5 sum of the object content)." value = element(concat(aws_s3_bucket_object.this.*.etag, [""]), 0) } -output "this_s3_bucket_object_version_id" { +output "s3_bucket_object_version_id" { description = "A unique version ID value for the object, if bucket versioning is enabled." value = element(concat(aws_s3_bucket_object.this.*.version_id, [""]), 0) } diff --git a/outputs.tf b/outputs.tf index c909f59b..6bb32f75 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,39 +1,39 @@ -output "this_s3_bucket_id" { +output "s3_bucket_id" { description = "The name of the bucket." value = element(concat(aws_s3_bucket_policy.this.*.id, aws_s3_bucket.this.*.id, [""]), 0) } -output "this_s3_bucket_arn" { +output "s3_bucket_arn" { description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." value = element(concat(aws_s3_bucket.this.*.arn, [""]), 0) } -output "this_s3_bucket_bucket_domain_name" { +output "s3_bucket_bucket_domain_name" { description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com." value = element(concat(aws_s3_bucket.this.*.bucket_domain_name, [""]), 0) } -output "this_s3_bucket_bucket_regional_domain_name" { +output "s3_bucket_bucket_regional_domain_name" { description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL." value = element(concat(aws_s3_bucket.this.*.bucket_regional_domain_name, [""]), 0) } -output "this_s3_bucket_hosted_zone_id" { +output "s3_bucket_hosted_zone_id" { description = "The Route 53 Hosted Zone ID for this bucket's region." value = element(concat(aws_s3_bucket.this.*.hosted_zone_id, [""]), 0) } -output "this_s3_bucket_region" { +output "s3_bucket_region" { description = "The AWS region this bucket resides in." value = element(concat(aws_s3_bucket.this.*.region, [""]), 0) } -output "this_s3_bucket_website_endpoint" { +output "s3_bucket_website_endpoint" { description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string." value = element(concat(aws_s3_bucket.this.*.website_endpoint, [""]), 0) } -output "this_s3_bucket_website_domain" { +output "s3_bucket_website_domain" { description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. " value = element(concat(aws_s3_bucket.this.*.website_domain, [""]), 0) }