Skip to content

Commit 821e006

Browse files
authored
Merge pull request #13 from tfstack/12-add-s3-bucket-attributes-to-outputs
feat: add s3 output variables
2 parents f00d53d + 49f09eb commit 821e006

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ No modules.
6666
| <a name="output_cloudfront_dns_name"></a> [cloudfront\_dns\_name](#output\_cloudfront\_dns\_name) | The DNS name for the CloudFront distribution, managed by Route 53, if CDN is enabled. |
6767
| <a name="output_cloudfront_website_url"></a> [cloudfront\_website\_url](#output\_cloudfront\_website\_url) | The website URL served through CloudFront when CDN is enabled. Empty if CDN is disabled. |
6868
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the S3 bucket. |
69+
| <a name="output_s3_bucket_domain_name"></a> [s3\_bucket\_domain\_name](#output\_s3\_bucket\_domain\_name) | The domain name of the S3 bucket (legacy global endpoint). |
6970
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The unique ID of the S3 bucket. |
7071
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region where the S3 bucket is deployed. |
72+
| <a name="output_s3_bucket_regional_domain_name"></a> [s3\_bucket\_regional\_domain\_name](#output\_s3\_bucket\_regional\_domain\_name) | The regional domain name of the S3 bucket (recommended for CloudFront origins). |
7173
| <a name="output_s3_logging_bucket"></a> [s3\_logging\_bucket](#output\_s3\_logging\_bucket) | The ID of the S3 bucket used for logging, if logging is enabled. Null if logging is disabled. |
7274
| <a name="output_s3_website_url"></a> [s3\_website\_url](#output\_s3\_website\_url) | The HTTP URL of the S3 static website. Note: HTTPS is not natively supported by S3. |
7375
| <a name="output_website_url"></a> [website\_url](#output\_website\_url) | The dynamic website URL, using Route 53 custom domain if CDN is enabled, otherwise S3. |

outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ output "s3_bucket_region" {
1313
description = "The AWS region where the S3 bucket is deployed."
1414
}
1515

16+
output "s3_bucket_domain_name" {
17+
value = aws_s3_bucket.this.bucket_domain_name
18+
description = "The domain name of the S3 bucket (legacy global endpoint)."
19+
}
20+
21+
output "s3_bucket_regional_domain_name" {
22+
value = aws_s3_bucket.this.bucket_regional_domain_name
23+
description = "The regional domain name of the S3 bucket (recommended for CloudFront origins)."
24+
}
25+
1626
output "s3_logging_bucket" {
1727
value = var.logging_config.enable ? aws_s3_bucket.logging[0].id : null
1828
description = "The ID of the S3 bucket used for logging, if logging is enabled. Null if logging is disabled."

0 commit comments

Comments
 (0)