aws-samples / aws-health-aware

AHA is an incident management & communication framework to provide real-time alert customers when there are active AWS event(s). For customers with AWS Organizations, customers can get aggregated active account level events of all the accounts in the Organization. Customers not using AWS Organizations still benefit alerting at the account level.
MIT No Attribution
348 stars 143 forks source link

Updates s3 resource to reflect aws provider upgrade to v4.0. #31

Open serkanh opened 2 years ago

serkanh commented 2 years ago

Issue #, if available: Updates s3 resource to reflect aws provider upgrade to v4.0. based on https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade\#acl-argument Without this upgrade Terraform plan will result in the following error:

➜  Terraform_DEPLOY_AHA git:(main) ✗ terraform plan
╷
│ Error: Value for unconfigurable attribute
│ 
│   with aws_s3_bucket.AHA-S3Bucket-PrimaryRegion,
│   on Terraform_DEPLOY_AHA.tf line 201, in resource "aws_s3_bucket" "AHA-S3Bucket-PrimaryRegion":
│  201:     acl        = "private"
│ 
│ Can't configure a value for "acl": its value will be decided automatically based on the result of applying this configuration.
╵
╷
│ Error: Value for unconfigurable attribute
│ 
│   with aws_s3_bucket.AHA-S3Bucket-SecondaryRegion,
│   on Terraform_DEPLOY_AHA.tf line 211, in resource "aws_s3_bucket" "AHA-S3Bucket-SecondaryRegion":
│  211:     acl        = "private"
│ 
│ Can't configure a value for "acl": its value will be decided automatically based on the result of applying this configuration.
╵
➜  Terraform_DEPLOY_AHA git:(aws-provider-v4-s3-upgrade) ✗ terraform --version
Terraform v1.1.6
on darwin_amd64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v4.4.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

dthomasag commented 2 years ago

Can someone provide an update on the status of this PR? I just ran into this as well.

dthomasag commented 2 years ago

By the way, it looks like the provider isn't locked to a version or range, so this could be an issue with each major update. It might be good to lock the AWS provider to a version to prevent this in the future.

FYI, there may be more changes necessary to update the S3 resources for 4.0. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#s3-bucket-refactor