Skip to content

Commit 6cf4584

Browse files
authored
feat: Added source_hash parameter to modules/object (#178)
1 parent 97eddfc commit 6cf4584

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

modules/object/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ No modules.
5151
| <a name="input_object_lock_mode"></a> [object\_lock\_mode](#input\_object\_lock\_mode) | The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE. | `string` | `null` | no |
5252
| <a name="input_object_lock_retain_until_date"></a> [object\_lock\_retain\_until\_date](#input\_object\_lock\_retain\_until\_date) | The date and time, in RFC3339 format, when this object's object lock will expire. | `string` | `null` | no |
5353
| <a name="input_server_side_encryption"></a> [server\_side\_encryption](#input\_server\_side\_encryption) | Specifies server-side encryption of the object in S3. Valid values are "AES256" and "aws:kms". | `string` | `null` | no |
54+
| <a name="input_source_hash"></a> [source\_hash](#input\_source\_hash) | Triggers updates like etag but useful to address etag encryption limitations. Set using filemd5("path/to/source") (Terraform 0.11.12 or later). (The value is only stored in state and not saved by AWS.) | `string` | `null` | no |
5455
| <a name="input_storage_class"></a> [storage\_class](#input\_storage\_class) | Specifies the desired Storage Class for the object. Can be either STANDARD, REDUCED\_REDUNDANCY, ONEZONE\_IA, INTELLIGENT\_TIERING, GLACIER, DEEP\_ARCHIVE, or STANDARD\_IA. Defaults to STANDARD. | `string` | `null` | no |
5556
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the object. | `map(string)` | `{}` | no |
5657
| <a name="input_website_redirect"></a> [website\_redirect](#input\_website\_redirect) | Specifies a target URL for website redirect. | `string` | `null` | no |

modules/object/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ resource "aws_s3_object" "this" {
2929
object_lock_mode = try(upper(var.object_lock_mode), var.object_lock_mode)
3030
object_lock_retain_until_date = var.object_lock_retain_until_date
3131

32+
source_hash = var.source_hash
33+
3234
tags = var.tags
3335

3436
lifecycle {

modules/object/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,9 @@ variable "object_lock_retain_until_date" {
141141
type = string
142142
default = null
143143
}
144+
145+
variable "source_hash" {
146+
description = "Triggers updates like etag but useful to address etag encryption limitations. Set using filemd5(\"path/to/source\") (Terraform 0.11.12 or later). (The value is only stored in state and not saved by AWS.)"
147+
type = string
148+
default = null
149+
}

wrappers/object/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ module "wrapper" {
2727
object_lock_legal_hold_status = try(each.value.object_lock_legal_hold_status, var.defaults.object_lock_legal_hold_status, null)
2828
object_lock_mode = try(each.value.object_lock_mode, var.defaults.object_lock_mode, null)
2929
object_lock_retain_until_date = try(each.value.object_lock_retain_until_date, var.defaults.object_lock_retain_until_date, null)
30+
source_hash = try(each.value.source_hash, var.defaults.source_hash, null)
3031
}

0 commit comments

Comments
 (0)