terraform-aws-tfstate-backend icon indicating copy to clipboard operation
terraform-aws-tfstate-backend copied to clipboard

terraform apply completes successfully with "Warning: Argument is deprecated"

Open gw-versent opened this issue 3 years ago • 3 comments

Describe the Bug

terraform apply completed successfully. However, there is a warning in the log that will need attention in future:

╷ │ Warning: Argument is deprecated │ │ with module.terraform_state_backend.module.log_storage.aws_s3_bucket.default, │ on .terraform/modules/terraform_state_backend.log_storage/main.tf line 1, in resource "aws_s3_bucket" "default": │ 1: resource "aws_s3_bucket" "default" { │ │ Use the aws_s3_bucket_logging resource instead │ │ (and 21 more similar warnings elsewhere)

Expected Behavior

No deprecated argument warning.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Add the below to my main.tf
module "terraform_state_backend" {
  source      = "cloudposse/tfstate-backend/aws"
  version     = "0.38.1"
  namespace   = "versent-digital-dev-kit"
  stage       = var.aws_region
  name        = "terraform"
  attributes  = ["state"]

  terraform_backend_config_file_path = "."
  terraform_backend_config_file_name = "backend.tf"
  force_destroy                      = false
}
  1. Run 'terraform apply -auto-approve'
  2. See warning in console output

Screenshots

Screen Shot 2022-07-15 at 13 53 33

gw-versent avatar Jul 15 '22 03:07 gw-versent

Here's a list of all of the deprecated arguments that generated a warning when I ran terraform plan:

→ terraform validate -json | jq '.diagnostics[] | {detail: .detail, filename: .range.filename, start_line: .range.start.line}'
{
  "detail": "Use the attribute \"override_policy_documents\" instead.",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 159
}
{
  "detail": "Use the attribute \"source_policy_documents\" instead.",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 158
}
{
  "detail": "Use the aws_s3_bucket_versioning resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 1
}
{
  "detail": "Use the aws_s3_bucket_server_side_encryption_configuration resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 1
}
{
  "detail": "Use the aws_s3_bucket_policy resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 8
}
{
  "detail": "Use the aws_s3_bucket_acl resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 6
}
{
  "detail": "Use the aws_s3_bucket_lifecycle_configuration resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 1
}
{
  "detail": "Use the aws_s3_bucket_logging resource instead",
  "filename": ".terraform/modules/terraform_state_backend.log_storage/main.tf",
  "start_line": 1
}
{
  "detail": "Use the aws_s3_bucket_acl resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 162
}
{
  "detail": "Use the aws_s3_bucket_logging resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 156
}
{
  "detail": "Use the aws_s3_bucket_server_side_encryption_configuration resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 156
}
{
  "detail": "Use the aws_s3_bucket_versioning resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 156
}
{
  "detail": "Use the aws_s3_bucket_policy resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 164
}
{
  "detail": "Use the aws_s3_bucket_replication_configuration resource instead",
  "filename": ".terraform/modules/terraform_state_backend/main.tf",
  "start_line": 156
}

vanastassiou avatar Jul 27 '22 20:07 vanastassiou

Yes, this needs to be updated in this module as at some point it will stop working with new aws tf provider.

dejwsz avatar Aug 01 '22 09:08 dejwsz

something like in this module probably: https://github.com/nozaq/terraform-aws-remote-state-s3-backend

dejwsz avatar Aug 01 '22 09:08 dejwsz

Any chance the PR could get merged? Or, some other means of addressing these issues?

matthewmrichter avatar Dec 27 '22 18:12 matthewmrichter

Yeah I want to use this module but is it deprecated? Why are the PR's to fix these basic errors blocked?

xophere avatar Mar 30 '23 21:03 xophere