Ao tentar executar o terraform apply apos alteracoes feitas no arquivo S3.tf apareceu as seguintes mensagens de erro:
│ Warning: Argument is deprecated │ │ with module.Producao.aws_s3_bucket_object.docker, │ on ../../infra/S3.tf line 9, in resource "aws_s3_bucket_object" "docker": │ 9: bucket = "ambiente" │ │ Use the aws_s3_object resource instead │ │ (and 2 more similar warnings elsewhere) ╵
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes
module.Producao.aws_s3_bucket.beanstalk_deploys: Creating... ╷ │ Error: creating Amazon S3 (Simple Storage) Bucket (producao-deploys): AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2' │ status code: 400, request id: 04DQ1VAWC5BFP7CX, host id: bmTGrof8e7beRP9KnEtUiNWL8/fpT/fjIYF6NtqABFHPU5JhGEEzAy7tyyJi8dcKa+iQD7E9eVU= │ │ with module.Producao.aws_s3_bucket.beanstalk_deploys, │ on ../../infra/S3.tf line 1, in resource "aws_s3_bucket" "beanstalk_deploys": │ 1: resource "aws_s3_bucket" "beanstalk_deploys" { │
Consegue me auxiliar por favor vou colocar o codigo do meu arquivo S3.tf aqui:
resource "aws_s3_bucket" "beanstalk_deploys" {
bucket = "${var.nome}-deploys"
}
resource "aws_s3_bucket_object" "docker" {
depends_on = [
aws_s3_bucket.beanstalk_deploys
]
bucket = "${var.nome}-deploys"
key = "${var.nome}.zip"
source = "${var.nome}.zip"
# The filemd5() function is available in Terraform 0.11.12 and later
# For Terraform 0.11.11 and earlier, use the md5() function and the file() function:
# etag = "${md5(file("path/to/file"))}"
etag = filemd5("${var.nome}.zip")
}