Skip to content

Commit 44e2667

Browse files
committed
Add bucket versioning status as an output
When creating replicated buckets, expose a versioning status output in order to be able to create a dependency on replica buckets being ready (versioning enabled). Otherwise applying replication rules targeting a bucket which isn't fully set up may fail.
1 parent a162988 commit 44e2667

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ No modules.
288288
| <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. |
289289
| <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. |
290290
| <a name="output_s3_bucket_region"></a> [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. |
291+
| <a name="output_aws_s3_bucket_versioning_status"></a> [aws\_s3\_bucket\_versioning\_status](#output\_aws\_s3\_bucket\_versioning\_status) | The versioning status of the bucket. Will be 'Enabled', 'Suspended', or 'Disabled'. |
291292
| <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. |
292293
| <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. |
293294
| <a name="output_s3_directory_bucket_arn"></a> [s3\_directory\_bucket\_arn](#output\_s3\_directory\_bucket\_arn) | ARN of the directory bucket. |

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,8 @@ output "s3_directory_bucket_arn" {
5757
description = "ARN of the directory bucket."
5858
value = try(aws_s3_directory_bucket.this[0].arn, null)
5959
}
60+
61+
output "aws_s3_bucket_versioning_status" {
62+
description = "The versioning status of the bucket. Will be 'Enabled', 'Suspended', or 'Disabled'."
63+
value = try(aws_s3_bucket_versioning.this[0].versioning_configuration[0].status, null)
64+
}

0 commit comments

Comments
 (0)