Skip to content

Commit 161026d

Browse files
authored
feat: Shorten outputs (removing this_) (terraform-aws-modules#88)
1 parent 7568c1e commit 161026d

File tree

18 files changed

+119
-127
lines changed

18 files changed

+119
-127
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.48.0
3+
rev: v1.50.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ No modules.
158158

159159
| Name | Description |
160160
|------|-------------|
161-
| <a name="output_this_s3_bucket_arn"></a> [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
162-
| <a name="output_this_s3_bucket_bucket_domain_name"></a> [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. |
163-
| <a name="output_this_s3_bucket_bucket_regional_domain_name"></a> [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. |
164-
| <a name="output_this_s3_bucket_hosted_zone_id"></a> [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
165-
| <a name="output_this_s3_bucket_id"></a> [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. |
166-
| <a name="output_this_s3_bucket_region"></a> [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. |
167-
| <a name="output_this_s3_bucket_website_domain"></a> [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. |
168-
| <a name="output_this_s3_bucket_website_endpoint"></a> [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. |
161+
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
162+
| <a name="output_s3_bucket_bucket_domain_name"></a> [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. |
163+
| <a name="output_s3_bucket_bucket_regional_domain_name"></a> [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. |
164+
| <a name="output_s3_bucket_hosted_zone_id"></a> [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
165+
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. |
166+
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
167+
| <a name="output_s3_bucket_website_domain"></a> [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. |
168+
| <a name="output_s3_bucket_website_endpoint"></a> [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. |
169169
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
170170

171171
## Authors

examples/complete/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ No inputs.
6666

6767
| Name | Description |
6868
|------|-------------|
69-
| <a name="output_this_s3_bucket_arn"></a> [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
70-
| <a name="output_this_s3_bucket_bucket_domain_name"></a> [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. |
71-
| <a name="output_this_s3_bucket_bucket_regional_domain_name"></a> [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. |
72-
| <a name="output_this_s3_bucket_hosted_zone_id"></a> [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
73-
| <a name="output_this_s3_bucket_id"></a> [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. |
74-
| <a name="output_this_s3_bucket_region"></a> [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. |
75-
| <a name="output_this_s3_bucket_website_domain"></a> [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. |
76-
| <a name="output_this_s3_bucket_website_endpoint"></a> [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. |
69+
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
70+
| <a name="output_s3_bucket_bucket_domain_name"></a> [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. |
71+
| <a name="output_s3_bucket_bucket_regional_domain_name"></a> [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. |
72+
| <a name="output_s3_bucket_hosted_zone_id"></a> [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
73+
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. |
74+
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
75+
| <a name="output_s3_bucket_website_domain"></a> [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. |
76+
| <a name="output_s3_bucket_website_endpoint"></a> [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. |
7777
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module "s3_bucket" {
112112
}
113113

114114
logging = {
115-
target_bucket = module.log_bucket.this_s3_bucket_id
115+
target_bucket = module.log_bucket.s3_bucket_id
116116
target_prefix = "log/"
117117
}
118118

examples/complete/outputs.tf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
output "this_s3_bucket_id" {
1+
output "s3_bucket_id" {
22
description = "The name of the bucket."
3-
value = module.s3_bucket.this_s3_bucket_id
3+
value = module.s3_bucket.s3_bucket_id
44
}
55

6-
output "this_s3_bucket_arn" {
6+
output "s3_bucket_arn" {
77
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname."
8-
value = module.s3_bucket.this_s3_bucket_arn
8+
value = module.s3_bucket.s3_bucket_arn
99
}
1010

11-
output "this_s3_bucket_bucket_domain_name" {
11+
output "s3_bucket_bucket_domain_name" {
1212
description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com."
13-
value = module.s3_bucket.this_s3_bucket_bucket_domain_name
13+
value = module.s3_bucket.s3_bucket_bucket_domain_name
1414
}
1515

16-
output "this_s3_bucket_bucket_regional_domain_name" {
16+
output "s3_bucket_bucket_regional_domain_name" {
1717
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."
18-
value = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name
18+
value = module.s3_bucket.s3_bucket_bucket_regional_domain_name
1919
}
2020

21-
output "this_s3_bucket_hosted_zone_id" {
21+
output "s3_bucket_hosted_zone_id" {
2222
description = "The Route 53 Hosted Zone ID for this bucket's region."
23-
value = module.s3_bucket.this_s3_bucket_hosted_zone_id
23+
value = module.s3_bucket.s3_bucket_hosted_zone_id
2424
}
2525

26-
output "this_s3_bucket_region" {
26+
output "s3_bucket_region" {
2727
description = "The AWS region this bucket resides in."
28-
value = module.s3_bucket.this_s3_bucket_region
28+
value = module.s3_bucket.s3_bucket_region
2929
}
3030

31-
output "this_s3_bucket_website_endpoint" {
31+
output "s3_bucket_website_endpoint" {
3232
description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string."
33-
value = module.s3_bucket.this_s3_bucket_website_endpoint
33+
value = module.s3_bucket.s3_bucket_website_endpoint
3434
}
3535

36-
output "this_s3_bucket_website_domain" {
36+
output "s3_bucket_website_domain" {
3737
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. "
38-
value = module.s3_bucket.this_s3_bucket_website_domain
38+
value = module.s3_bucket.s3_bucket_website_domain
3939
}

examples/notification/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Note that this example may create resources which cost money. Run `terraform des
5252
| [null_resource.download_package](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
5353
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource |
5454
| [aws_iam_policy_document.sqs_external](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
55-
| [null_data_source.downloaded_package](https://registry.terraform.io/providers/hashicorp/null/latest/docs/data-sources/data_source) | data source |
5655

5756
## Inputs
5857

@@ -62,12 +61,12 @@ No inputs.
6261

6362
| Name | Description |
6463
|------|-------------|
65-
| <a name="output_this_s3_bucket_arn"></a> [this\_s3\_bucket\_arn](#output\_this\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
66-
| <a name="output_this_s3_bucket_bucket_domain_name"></a> [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. |
67-
| <a name="output_this_s3_bucket_bucket_regional_domain_name"></a> [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. |
68-
| <a name="output_this_s3_bucket_hosted_zone_id"></a> [this\_s3\_bucket\_hosted\_zone\_id](#output\_this\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
69-
| <a name="output_this_s3_bucket_id"></a> [this\_s3\_bucket\_id](#output\_this\_s3\_bucket\_id) | The name of the bucket. |
70-
| <a name="output_this_s3_bucket_region"></a> [this\_s3\_bucket\_region](#output\_this\_s3\_bucket\_region) | The AWS region this bucket resides in. |
71-
| <a name="output_this_s3_bucket_website_domain"></a> [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. |
72-
| <a name="output_this_s3_bucket_website_endpoint"></a> [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. |
64+
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. |
65+
| <a name="output_s3_bucket_bucket_domain_name"></a> [s3\_bucket\_bucket\_domain\_name](#output\_s3\_bucket\_bucket\_domain\_name) | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. |
66+
| <a name="output_s3_bucket_bucket_regional_domain_name"></a> [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. |
67+
| <a name="output_s3_bucket_hosted_zone_id"></a> [s3\_bucket\_hosted\_zone\_id](#output\_s3\_bucket\_hosted\_zone\_id) | The Route 53 Hosted Zone ID for this bucket's region. |
68+
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. |
69+
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
70+
| <a name="output_s3_bucket_website_domain"></a> [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. |
71+
| <a name="output_s3_bucket_website_endpoint"></a> [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. |
7372
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/notification/main.tf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ resource "null_resource" "download_package" {
3232
}
3333
}
3434

35-
data "null_data_source" "downloaded_package" {
36-
inputs = {
37-
id = null_resource.download_package.id
38-
filename = local.downloaded
39-
}
40-
}
41-
4235
module "lambda_function1" {
4336
source = "terraform-aws-modules/lambda/aws"
4437
version = "~> 1.0"
@@ -48,7 +41,7 @@ module "lambda_function1" {
4841
runtime = "python3.8"
4942

5043
create_package = false
51-
local_existing_package = data.null_data_source.downloaded_package.outputs["filename"]
44+
local_existing_package = local.downloaded
5245
}
5346

5447
module "lambda_function2" {
@@ -60,7 +53,7 @@ module "lambda_function2" {
6053
runtime = "python3.8"
6154

6255
create_package = false
63-
local_existing_package = data.null_data_source.downloaded_package.outputs["filename"]
56+
local_existing_package = local.downloaded
6457
}
6558

6659
module "sns_topic1" {
@@ -99,7 +92,7 @@ resource "aws_sqs_queue_policy" "allow_external" {
9992
module "all_notifications" {
10093
source = "../../modules/notification"
10194

102-
bucket = module.s3_bucket.this_s3_bucket_id
95+
bucket = module.s3_bucket.s3_bucket_id
10396

10497
# 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.
10598

examples/notification/outputs.tf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
output "this_s3_bucket_id" {
1+
output "s3_bucket_id" {
22
description = "The name of the bucket."
3-
value = module.s3_bucket.this_s3_bucket_id
3+
value = module.s3_bucket.s3_bucket_id
44
}
55

6-
output "this_s3_bucket_arn" {
6+
output "s3_bucket_arn" {
77
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname."
8-
value = module.s3_bucket.this_s3_bucket_arn
8+
value = module.s3_bucket.s3_bucket_arn
99
}
1010

11-
output "this_s3_bucket_bucket_domain_name" {
11+
output "s3_bucket_bucket_domain_name" {
1212
description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com."
13-
value = module.s3_bucket.this_s3_bucket_bucket_domain_name
13+
value = module.s3_bucket.s3_bucket_bucket_domain_name
1414
}
1515

16-
output "this_s3_bucket_bucket_regional_domain_name" {
16+
output "s3_bucket_bucket_regional_domain_name" {
1717
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."
18-
value = module.s3_bucket.this_s3_bucket_bucket_regional_domain_name
18+
value = module.s3_bucket.s3_bucket_bucket_regional_domain_name
1919
}
2020

21-
output "this_s3_bucket_hosted_zone_id" {
21+
output "s3_bucket_hosted_zone_id" {
2222
description = "The Route 53 Hosted Zone ID for this bucket's region."
23-
value = module.s3_bucket.this_s3_bucket_hosted_zone_id
23+
value = module.s3_bucket.s3_bucket_hosted_zone_id
2424
}
2525

26-
output "this_s3_bucket_region" {
26+
output "s3_bucket_region" {
2727
description = "The AWS region this bucket resides in."
28-
value = module.s3_bucket.this_s3_bucket_region
28+
value = module.s3_bucket.s3_bucket_region
2929
}
3030

31-
output "this_s3_bucket_website_endpoint" {
31+
output "s3_bucket_website_endpoint" {
3232
description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string."
33-
value = module.s3_bucket.this_s3_bucket_website_endpoint
33+
value = module.s3_bucket.s3_bucket_website_endpoint
3434
}
3535

36-
output "this_s3_bucket_website_domain" {
36+
output "s3_bucket_website_domain" {
3737
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. "
38-
value = module.s3_bucket.this_s3_bucket_website_domain
38+
value = module.s3_bucket.s3_bucket_website_domain
3939
}

0 commit comments

Comments
 (0)