Skip to content

Commit 4267aba

Browse files
authored
platform/4040: feat: add additional_transfer_job_excluded_prefixes variable for transfer job customization (#30)
1 parent 387890c commit 4267aba

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres
77
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
# [0.11.0] - 2025-12-10
10+
11+
[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-application-bucket-creation-helper/compare/0.10.0...0.11.0)
12+
13+
- Added `additional_transfer_job_excluded_prefixes` variable to allow excluding specific prefixes from the transfer job.
14+
915
# [0.10.0] - 2024-11-26
1016

1117
[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-application-bucket-creation-helper/compare/0.9.0...0.10.0)
@@ -54,7 +60,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5460

5561
[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-application-bucket-creation-helper/compare/0.6.1...0.7.0)
5662

57-
- **BREAKING CHANGES**: tags are now passed using a user-friendly name as
63+
- **BREAKING CHANGES**: tags are now passed using a user-friendly name as
5864
`<TAG_KEY_SHORTNAME>/<TAG_VALUE_SHORTNAME>` instead of the tag value.
5965
- Support global tags to be applied to all buckets. If a bucket specify a list
6066
of tags, the global tags will be overridden and replaced by those specified for

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ want to import existing buckets with a known name.
8585

8686
| Name | Description | Type | Default | Required |
8787
|------|-------------|------|---------|:--------:|
88+
| <a name="input_additional_transfer_job_excluded_prefixes"></a> [additional\_transfer\_job\_excluded\_prefixes](#input\_additional\_transfer\_job\_excluded\_prefixes) | A list of additional object file and folder prefixes that will be excluded from the transfer job. | `list(string)` | `[]` | no |
8889
| <a name="input_buckets_list"></a> [buckets\_list](#input\_buckets\_list) | The list of buckets to create. For each bucket you can specify the name, when deleting a bucket the force\_destroy option will delete the contents of the bucket (if you try to delete a bucket that contains objects, Terraform will fail that run), the location (default to project region), the storage class (default to STANDARD), if you want enable the object versioning (default to true), if you want to plan a disaster recovery with the creation of a mirroring bucket with a scheduled transfer job and if you want to append a random suffix to the bucket name (default true). The property set\_all\_users\_as\_viewer controls if the bucket will be readable by all users (default false). The property labels set labels to organize buckets. The property tag\_list set google tags to bind with the bucket for fine grained access control. Properties bucket\_obj\_vwr and bucket\_obj\_adm set a list of specific IAM members as objectViewers and objectAdmin | <pre>list(object({<br/> name = string<br/> force_destroy = optional(bool, false)<br/> append_random_suffix = optional(bool, true)<br/> location = optional(string, null)<br/> storage_class = optional(string, "STANDARD")<br/> enable_versioning = optional(bool, true)<br/> enable_disaster_recovery = optional(bool, true)<br/> set_all_users_as_viewer = optional(bool, false)<br/> labels = optional(map(string), {})<br/> tag_list = optional(list(string), [])<br/> bucket_obj_adm = optional(list(string), [])<br/> bucket_obj_vwr = optional(list(string), [])<br/> soft_delete_retention_seconds = optional(number, 0)<br/> lifecycle_policy_retention = optional(number, 30)<br/> dr_soft_delete_retention_seconds = optional(number, 0)<br/> dr_lifecycle_policy_retention = optional(number, 60)<br/> }))</pre> | n/a | yes |
8990
| <a name="input_disaster_recovery_bucket_location"></a> [disaster\_recovery\_bucket\_location](#input\_disaster\_recovery\_bucket\_location) | The location in which the disaster recovery bucket will be created. For a list of available regions, see https://cloud.google.com/storage/docs/locations. By default, the disaster recovery bucket will be created in the same location as the primary bucket. | `string` | `""` | no |
9091
| <a name="input_global_tags"></a> [global\_tags](#input\_global\_tags) | A list of tags to be applied to all the resources, in the form <TAG\_KEY\_SHORTNAME>/<TAG\_VALUE\_SHORTNAME>. If a resource specify a list of tags, the global tags will be overridden and replaced by those specified in the resource. | `list(string)` | `[]` | no |

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Data resources.
1+
# Data resources.
22
data "google_client_config" "current" {}
33

44
locals {
@@ -294,7 +294,7 @@ resource "google_storage_transfer_job" "application_bucket_nightly_backup" {
294294

295295
transfer_spec {
296296
object_conditions {
297-
exclude_prefixes = var.transfer_job_excluded_prefixes
297+
exclude_prefixes = concat(var.transfer_job_excluded_prefixes, var.additional_transfer_job_excluded_prefixes)
298298
}
299299

300300
transfer_options {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ variable "transfer_job_excluded_prefixes" {
2727
]
2828
}
2929

30+
variable "additional_transfer_job_excluded_prefixes" {
31+
type = list(string)
32+
description = "A list of additional object file and folder prefixes that will be excluded from the transfer job."
33+
default = []
34+
}
35+
3036
variable "global_tags" {
3137
description = "A list of tags to be applied to all the resources, in the form <TAG_KEY_SHORTNAME>/<TAG_VALUE_SHORTNAME>. If a resource specify a list of tags, the global tags will be overridden and replaced by those specified in the resource."
3238
type = list(string)

0 commit comments

Comments
 (0)