Skip to content

Commit

Permalink
feat: Added outputs for s3 bucket lifecycle rules and policy (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhollerbach authored May 25, 2023
1 parent 96226df commit 24b88e8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ No modules.
| <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. |
| <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. |
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. |
| <a name="output_s3_bucket_lifecycle_configuration_rules"></a> [s3\_bucket\_lifecycle\_configuration\_rules](#output\_s3\_bucket\_lifecycle\_configuration\_rules) | The lifecycle rules of the bucket, if the bucket is configured with lifecycle rules. If not, this will be an empty string. |
| <a name="output_s3_bucket_policy"></a> [s3\_bucket\_policy](#output\_s3\_bucket\_policy) | The policy of the bucket, if the bucket is configured with a policy. If not, this will be an empty string. |
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
| <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. |
| <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. |
Expand Down
2 changes: 2 additions & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ No inputs.
| <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. |
| <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. |
| <a name="output_s3_bucket_id"></a> [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. |
| <a name="output_s3_bucket_lifecycle_configuration_rules"></a> [s3\_bucket\_lifecycle\_configuration\_rules](#output\_s3\_bucket\_lifecycle\_configuration\_rules) | The lifecycle rules of the bucket, if the bucket is configured with lifecycle rules. If not, this will be an empty string. |
| <a name="output_s3_bucket_policy"></a> [s3\_bucket\_policy](#output\_s3\_bucket\_policy) | The policy of the bucket, if the bucket is configured with a policy. If not, this will be an empty string. |
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
| <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. |
| <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. |
Expand Down
10 changes: 10 additions & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ output "s3_bucket_hosted_zone_id" {
value = module.s3_bucket.s3_bucket_hosted_zone_id
}

output "s3_bucket_lifecycle_configuration_rules" {
description = "The lifecycle rules of the bucket, if the bucket is configured with lifecycle rules. If not, this will be an empty string."
value = module.s3_bucket.s3_bucket_lifecycle_configuration_rules
}

output "s3_bucket_policy" {
description = "The policy of the bucket, if the bucket is configured with a policy. If not, this will be an empty string."
value = module.s3_bucket.s3_bucket_policy
}

output "s3_bucket_region" {
description = "The AWS region this bucket resides in."
value = module.s3_bucket.s3_bucket_region
Expand Down
1 change: 0 additions & 1 deletion examples/notification/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ provider "aws" {
region = local.region

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand Down
1 change: 0 additions & 1 deletion examples/object/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ provider "aws" {
region = local.region

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand Down
1 change: 0 additions & 1 deletion examples/s3-inventory/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ provider "aws" {
region = local.region

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand Down
2 changes: 0 additions & 2 deletions examples/s3-replication/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ provider "aws" {
region = local.origin_region

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand All @@ -15,7 +14,6 @@ provider "aws" {
alias = "replica"

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand Down
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ output "s3_bucket_hosted_zone_id" {
value = try(aws_s3_bucket.this[0].hosted_zone_id, "")
}

output "s3_bucket_lifecycle_configuration_rules" {
description = "The lifecycle rules of the bucket, if the bucket is configured with lifecycle rules. If not, this will be an empty string."
value = try(aws_s3_bucket_lifecycle_configuration.this[0].rule, "")
}

output "s3_bucket_policy" {
description = "The policy of the bucket, if the bucket is configured with a policy. If not, this will be an empty string."
value = try(aws_s3_bucket_policy.this[0].policy, "")
}

output "s3_bucket_region" {
description = "The AWS region this bucket resides in."
value = try(aws_s3_bucket.this[0].region, "")
Expand Down

0 comments on commit 24b88e8

Please sign in to comment.