Skip to content

Commit 70d08fd

Browse files
authored
feat: Upgraded AWS provider to 4.5, fixed object_lock_enabled (#149)
1 parent 20c898d commit 70d08fd

File tree

15 files changed

+35
-35
lines changed

15 files changed

+35
-35
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.64.0
3+
rev: v1.66.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.1.0
26+
rev: v4.2.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ inputs = {
110110
| Name | Version |
111111
|------|---------|
112112
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
113-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.75 |
113+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.5 |
114114

115115
## Providers
116116

117117
| Name | Version |
118118
|------|---------|
119-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.75 |
119+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.5 |
120120

121121
## Modules
122122

@@ -175,6 +175,7 @@ No modules.
175175
| <a name="input_lifecycle_rule"></a> [lifecycle\_rule](#input\_lifecycle\_rule) | List of maps containing configuration of object lifecycle management. | `any` | `[]` | no |
176176
| <a name="input_logging"></a> [logging](#input\_logging) | Map containing access bucket logging configuration. | `map(string)` | `{}` | no |
177177
| <a name="input_object_lock_configuration"></a> [object\_lock\_configuration](#input\_object\_lock\_configuration) | Map containing S3 object locking configuration. | `any` | `{}` | no |
178+
| <a name="input_object_lock_enabled"></a> [object\_lock\_enabled](#input\_object\_lock\_enabled) | Whether S3 bucket should have an Object Lock configuration enabled. | `bool` | `false` | no |
178179
| <a name="input_object_ownership"></a> [object\_ownership](#input\_object\_ownership) | Object ownership. Valid values: BucketOwnerEnforced, BucketOwnerPreferred or ObjectWriter. 'BucketOwnerEnforced': ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. 'BucketOwnerPreferred': Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL. 'ObjectWriter': The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL. | `string` | `"ObjectWriter"` | no |
179180
| <a name="input_owner"></a> [owner](#input\_owner) | Bucket owner's display name and ID. Conflicts with `acl` | `map(string)` | `{}` | no |
180181
| <a name="input_policy"></a> [policy](#input\_policy) | (Optional) A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide. | `string` | `null` | no |

UPGRADE-3.0.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ If you find a bug, please open an issue with supporting configuration to reprodu
66

77
## List of backwards incompatible changes
88

9-
- Terraform AWS provider minimum version is now `v3.75.0` in order to have forward compatibility with Terraform AWS provider `v4.x`. Using the latest version of `v4` is highly recommended, if possible.
10-
- Main group of changes is related to refactoring of `aws_s3_bucket` resource into several smaller resources. Read [`S3 bucket refactor` section in the official Terraform AWS Provider Version 4 Upgrade Guide](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#s3-bucket-refactor) and [discussion around these changes](https://github.com/hashicorp/terraform-provider-aws/issues/23106) can help even when using AWS provider version 3.75 or newer.
9+
- Terraform AWS provider minimum version is now `v4.5.0` in order to have forward compatibility with Terraform AWS provider `v4.x`. Using the latest version of `v4` is highly recommended, if possible.
10+
- If you are using AWS provider `v3.75` the latest supported version of this module is `v3.0.1`
11+
- Main group of changes is related to refactoring of `aws_s3_bucket` resource into several smaller resources. Read [`S3 bucket refactor` section in the official Terraform AWS Provider Version 4 Upgrade Guide](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#s3-bucket-refactor) and [discussion around these changes](https://github.com/hashicorp/terraform-provider-aws/issues/23106).
1112
- `modules/object`: Changed resource type from `aws_bucket_s3_object` to `aws_s3_object`. After upgrade, on the next apply, Terraform will recreate the object. If you prefer to not have Terraform recreate the object, import the object using `aws_s3_object`. [Read more](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object#import).
1213

1314
## Additional changes
@@ -91,7 +92,7 @@ module "s3_bucket" {
9192
9293
terraform {
9394
required_providers {
94-
aws = ">= 3.75" # or anything higher than 3.75.0
95+
aws = ">= 4.5" # or anything higher than 4.5.0
9596
}
9697
}
9798
```

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.13.1 |
33-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.75 |
33+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.5 |
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.75 |
40+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.5 |
4141
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
4242

4343
## Modules

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ module "s3_bucket" {
116116

117117
# Note: Object Lock configuration can be enabled only on new buckets
118118
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object_lock_configuration
119+
object_lock_enabled = true
119120
object_lock_configuration = {
120-
object_lock_enabled = false
121121
rule = {
122122
default_retention = {
123123
mode = "GOVERNANCE"

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.75"
7+
version = ">= 4.5"
88
}
99
random = {
1010
source = "hashicorp/random"

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.13.1 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.75 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.5 |
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.75 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.5 |
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
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.75"
7+
version = ">= 4.5"
88
}
99
random = {
1010
source = "hashicorp/random"

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.1 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.75 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.5 |
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.75 |
30+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.5 |
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
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.75"
7+
version = ">= 4.5"
88
}
99
random = {
1010
source = "hashicorp/random"

0 commit comments

Comments
 (0)