diff --git a/CHANGELOG.md b/CHANGELOG.md index d7cded9..bf76912 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-application-bucket-creation-helper/compare/0.11.0...0.12.0) +### Added + +- Added output `disaster_recovery_bucket_names` to provide a map from input bucket names to disaster recovery bucket names. + ### Fixed - Fixed `bucket_obj_adm` and `bucket_obj_vwr` variables causing "Invalid for_each argument" error when used with `append_random_suffix = true`. The `for_each` key for IAM member resources now uses the static input bucket name instead of the dynamically generated name (with random suffix). diff --git a/README.md b/README.md index edb4efc..2b46ecb 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ want to import existing buckets with a known name. | [buckets\_access\_credentials](#output\_buckets\_access\_credentials) | Access credentials for the application buckets | | [details\_of\_used\_tag\_keys](#output\_details\_of\_used\_tag\_keys) | Details of all the tag keys passed to this module (globals and per bucket). | | [details\_of\_used\_tag\_values](#output\_details\_of\_used\_tag\_values) | Details of all the tag values passed to this module (globals and per bucket). | +| [disaster\_recovery\_bucket\_names](#output\_disaster\_recovery\_bucket\_names) | Map from input bucket name to disaster recovery bucket name. Use values() to get a list. | | [generated\_bucket\_names](#output\_generated\_bucket\_names) | The list with the names of the buckets managed by this module. | ## Resources diff --git a/outputs.tf b/outputs.tf index 610a85a..9e20f4d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -25,3 +25,8 @@ output "generated_bucket_names" { description = "The list with the names of the buckets managed by this module." value = [for k, v in local.generated_bucket_names : v] } + +output "disaster_recovery_bucket_names" { + description = "Map from input bucket name to disaster recovery bucket name. Use values() to get a list." + value = { for k, bucket in google_storage_bucket.disaster_recovery : k => bucket.name } +}