Skip to content

Commit a41d75f

Browse files
authored
feat: support bucket_key_enabled for SSE (terraform-aws-modules#82)
1 parent 5832e7c commit a41d75f

File tree

16 files changed

+30
-21
lines changed

16 files changed

+30
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ inputs = {
9999
| Name | Version |
100100
|------|---------|
101101
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
102-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
102+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
103103

104104
## Providers
105105

106106
| Name | Version |
107107
|------|---------|
108-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
108+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
109109

110110
## Modules
111111

examples/complete/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ Note that this example may create resources which cost money. Run `terraform des
3030
| Name | Version |
3131
|------|---------|
3232
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
33-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
33+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
3434
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
3535

3636
## Providers
3737

3838
| Name | Version |
3939
|------|---------|
40-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
40+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
4141
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
4242

4343
## Modules

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.12.26"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
random = ">= 2.0"
77
}
88
}

examples/notification/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
2424
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
2525
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2626

2727
## Providers
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
3232
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.0 |
3333
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3434

examples/notification/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.12.26"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
random = ">= 2.0"
77
null = ">= 2.0"
88
}

examples/object/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
2424
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2525

2626
## Providers
2727

2828
| Name | Version |
2929
|------|---------|
30-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
30+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
3131
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3232

3333
## Modules

examples/object/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.13"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
random = ">= 2.0"
77
}
88
}

examples/s3-replication/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
2626
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2727

2828
## Providers
2929

3030
| Name | Version |
3131
|------|---------|
32-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
33-
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.28 |
32+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
33+
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.36 |
3434
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3535

3636
## Modules

examples/s3-replication/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resource "random_pet" "this" {
2222
}
2323

2424
resource "aws_kms_key" "replica" {
25-
provider = "aws.replica"
25+
provider = aws.replica
2626

2727
description = "S3 bucket replication KMS key"
2828
deletion_window_in_days = 7
@@ -32,7 +32,7 @@ module "replica_bucket" {
3232
source = "../../"
3333

3434
providers = {
35-
aws = "aws.replica"
35+
aws = aws.replica
3636
}
3737

3838
bucket = local.destination_bucket_name

examples/s3-replication/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.12.26"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
random = ">= 2.0"
77
}
88
}

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ resource "aws_s3_bucket" "this" {
196196
for_each = length(keys(lookup(server_side_encryption_configuration.value, "rule", {}))) == 0 ? [] : [lookup(server_side_encryption_configuration.value, "rule", {})]
197197

198198
content {
199+
bucket_key_enabled = lookup(rule.value, "bucket_key_enabled", null)
199200

200201
dynamic "apply_server_side_encryption_by_default" {
201202
for_each = length(keys(lookup(rule.value, "apply_server_side_encryption_by_default", {}))) == 0 ? [] : [

modules/object/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Creates S3 bucket objects with different configurations.
88
| Name | Version |
99
|------|---------|
1010
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
11-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
11+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
1212

1313
## Providers
1414

1515
| Name | Version |
1616
|------|---------|
17-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
17+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
1818

1919
## Modules
2020

@@ -32,6 +32,7 @@ No modules.
3232
|------|-------------|------|---------|:--------:|
3333
| <a name="input_acl"></a> [acl](#input\_acl) | The canned ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, and bucket-owner-full-control. Defaults to private. | `string` | `null` | no |
3434
| <a name="input_bucket"></a> [bucket](#input\_bucket) | The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified. | `string` | `""` | no |
35+
| <a name="input_bucket_key_enabled"></a> [bucket\_key\_enabled](#input\_bucket\_key\_enabled) | Whether or not to use Amazon S3 Bucket Keys for SSE-KMS. | `bool` | `null` | no |
3536
| <a name="input_cache_control"></a> [cache\_control](#input\_cache\_control) | Specifies caching behavior along the request/reply chain. | `string` | `null` | no |
3637
| <a name="input_content"></a> [content](#input\_content) | Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. | `string` | `null` | no |
3738
| <a name="input_content_base64"></a> [content\_base64](#input\_content\_base64) | Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file. | `string` | `null` | no |

modules/object/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ resource "aws_s3_bucket_object" "this" {
2323

2424
server_side_encryption = var.server_side_encryption
2525
kms_key_id = var.kms_key_id
26+
bucket_key_enabled = var.bucket_key_enabled
2627

2728
object_lock_legal_hold_status = try(tobool(var.object_lock_legal_hold_status) ? "ON" : upper(var.object_lock_legal_hold_status), var.object_lock_legal_hold_status)
2829
object_lock_mode = try(upper(var.object_lock_mode), var.object_lock_mode)

modules/object/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ variable "kms_key_id" {
100100
default = null
101101
}
102102

103+
variable "bucket_key_enabled" {
104+
description = "Whether or not to use Amazon S3 Bucket Keys for SSE-KMS."
105+
type = bool
106+
default = null
107+
}
108+
103109
variable "metadata" {
104110
description = "A map of keys/values to provision metadata (will be automatically prefixed by x-amz-meta-, note that only lowercase label are currently supported by the AWS Go API)."
105111
type = map(string)

modules/object/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.13"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
}
77
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.12.26"
33

44
required_providers {
5-
aws = ">= 3.28"
5+
aws = ">= 3.36"
66
}
77
}

0 commit comments

Comments
 (0)