Skip to content

Commit e823780

Browse files
authored
fix: Making retention_policy is_locked as optional field (#394)
1 parent 59cd793 commit e823780

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

examples/simple_bucket/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@ module "bucket" {
5555
}]
5656

5757
autoclass = true
58+
retention_policy = {
59+
retention_period = 2
60+
}
5861
}

modules/simple_bucket/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Functional examples are included in the
5454
| name | The name of the bucket. | `string` | n/a | yes |
5555
| project\_id | The ID of the project to create the bucket in. | `string` | n/a | yes |
5656
| public\_access\_prevention | Prevents public access to a bucket. Acceptable values are inherited or enforced. If inherited, the bucket uses public access prevention, only if the bucket is subject to the public access prevention organization policy constraint. | `string` | `"inherited"` | no |
57-
| retention\_policy | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br> is_locked = bool<br> retention_period = number<br> })</pre> | `null` | no |
57+
| retention\_policy | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br> is_locked = optional(bool)<br> retention_period = number<br> })</pre> | `null` | no |
5858
| soft\_delete\_policy | Soft delete policies to apply. Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#nested_soft_delete_policy | <pre>object({<br> retention_duration_seconds = optional(number)<br> })</pre> | `{}` | no |
5959
| storage\_class | The Storage Class of the new bucket. | `string` | `null` | no |
6060
| versioning | While set to true, versioning is fully enabled for this bucket. | `bool` | `true` | no |

modules/simple_bucket/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
description: Configuration of the bucket's data retention policy for how long objects in the bucket should be retained.
101101
varType: |-
102102
object({
103-
is_locked = bool
103+
is_locked = optional(bool)
104104
retention_period = number
105105
})
106106
- name: custom_placement_config

modules/simple_bucket/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ variable "autoclass" {
7878
variable "retention_policy" {
7979
description = "Configuration of the bucket's data retention policy for how long objects in the bucket should be retained."
8080
type = object({
81-
is_locked = bool
81+
is_locked = optional(bool)
8282
retention_period = number
8383
})
8484
default = null

0 commit comments

Comments
 (0)