Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tons of s3 "argument is deprecated" warnings #116

Open
nk9 opened this issue May 12, 2022 · 1 comment
Open

Tons of s3 "argument is deprecated" warnings #116

nk9 opened this issue May 12, 2022 · 1 comment
Labels
bug 🐛 An issue with the system

Comments

@nk9
Copy link

nk9 commented May 12, 2022

Describe the Bug

Create an ALB and plan it, and you will get 15 warnings about deprecated S3 arguments. Example:

Warning: Argument is deprecated
with module.project_module.module.alb.module.access_logs.module.s3_bucket.aws_s3_bucket.default
on .terraform/modules/project_module.alb.access_logs.s3_bucket/main.tf line 1, in resource "aws_s3_bucket" "default":

resource "aws_s3_bucket" "default" {

Use the aws_s3_bucket_lifecycle_configuration resource instead

Expected Behavior

No warnings.

Steps to Reproduce

provider "aws" {
  region = var.region
}

# Fetch the pre-existing domain certificate
data "aws_acm_certificate" "domain_cert" {
  domain      = var.domain
  statuses    = ["ISSUED"]
  most_recent = true
}

module "alb" {
  source  = "cloudposse/alb/aws"
  version = "1.1.0"

  attributes = ["alb"]
  tags       = { "declaration" : "alb" }

  vpc_id             = module.vpc.vpc_id
  security_group_ids = [module.vpc.vpc_default_security_group_id]
  subnet_ids         = module.subnets.public_subnet_ids
  internal           = false

  target_group_port = 5000
  http2_enabled   = true
  https_enabled   = true
  certificate_arn = data.aws_acm_certificate.domain_cert.arn
  http_redirect   = true

  access_logs_enabled                     = true
  alb_access_logs_s3_bucket_force_destroy = true
  cross_zone_load_balancing_enabled       = true
  deletion_protection_enabled             = false

  health_check_interval = 30

  context = module.this.context
}

Screenshots

Screenshot 2022-05-12 at 12 40 42

Environment (please complete the following information):

I'm using Terraform Cloud with Terraform 1.1.9

Additional Context

This is presumably related to the changes to the AWS 4 provider. terraform-aws-s3-bucket has been updated (latest version 2.0.1) but the module this module relies upon (aws-lb-s3-bucket) hasn't been updated.

@nk9 nk9 added the bug 🐛 An issue with the system label May 12, 2022
@nk9 nk9 changed the title Tons of s3 warnings Tons of s3 "argument is deprecated" warnings May 12, 2022
@nitrocode
Copy link
Member

Hi @nk9 . This will take some time to complete. The underlying s3 bucket module has been upgraded and no longer contains these deprecated arguments but a lot of our child modules that consume the s3 bucket module have not been upgraded yet.

Currently this module consumes cloudposse/lb-s3-bucket/aws

module "access_logs" {
source = "cloudposse/lb-s3-bucket/aws"
version = "0.16.0"

Which consumes cloudposse/lb-s3-bucket/aws

https://github.com/cloudposse/terraform-aws-lb-s3-bucket/blob/4bd8e00b6baa2c885afc194cf6d03efd8addc7f1/main.tf#L61-L63

Which consumes cloudposse/s3-bucket/aws and this currently uses 0.x instead of the latest

https://github.com/cloudposse/terraform-aws-s3-log-storage/blob/cb983370a2fcfefac4731d6d06d232ee246b59b5/main.tf#L52-L54

See the latest s3-bucket module version

https://github.com/cloudposse/terraform-aws-s3-bucket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants