terraform-aws-modules / terraform-aws-s3-bucket

Terraform module to create AWS S3 resources πŸ‡ΊπŸ‡¦

Home Page:https://registry.terraform.io/modules/terraform-aws-modules/s3-bucket/aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support terraform-provider-aws 4.x

mgerlach opened this issue Β· comments

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

https://github.com/hashicorp/terraform-provider-aws 4.0.0 has breaking changes for the S3 bucket resource, see https://github.com/hashicorp/terraform-provider-aws/releases/tag/v4.0.0, which break this module (e. g.: lifecycle configuration must no be specified as separate resource)

Describe the solution you'd like.

This module should work with https://github.com/hashicorp/terraform-provider-aws 4.x.x

Describe alternatives you've considered.

We could abandon use of this module, but really don't want to ;)

Additional context

N/A

also faced with this problem:
Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints ~> 3.69, 4.0.0

This is the real problem:

Screenshot from 2022-02-10 20-35-38

To solve the problem force the version of provider to the previous version, in my case I used 3.74.1 and this was the result:
Screenshot from 2022-02-10 20-34-52

Versions

  • Terraform v1.1.5
  • AWS Provider: 3.74.1
  • Module S3: v2.14.1

They pulled stuff like logging and lifecycle rule out of the bucket resource into separate resources. That's why it's the values are unconfigurable.

People will eventually want to use version 4.x of the provider.

Thanks for opening this issue. We are well aware of version 4.x and we will work on the support in the coming weeks.

For the time being, please use version 2.14.1 of this module where Terraform AWS provider version is locked to ~> 3.69

how do you force the use of a previous version of a module?

I've set the provider version as follows:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.69"
    }
  }

  required_version = "~> 1.1.4"
}

...and I have set the S3 module as follows:

module "s3_playbooks" {
  source = "terraform-aws-modules/s3-bucket/aws"
  version = "2.14.1"

But am still getting the error:
Initializing provider plugins...

  • Finding hashicorp/aws versions matching ">= 3.62.0, >= 3.63.0, ~> 3.69, >= 3.72.0, >= 4.0.0"...
  • Finding hashicorp/random versions matching ">= 3.1.0"...
  • Installing hashicorp/random v3.1.0...
  • Installed hashicorp/random v3.1.0 (signed by HashiCorp)
    β•·
    β”‚ Error: Failed to query available provider packages
    β”‚
    β”‚ Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 3.62.0, >= 3.63.0, ~> 3.69, >=
    β”‚ 3.72.0, >= 4.0.0

You have other modules in this configuration that require >= 4.0.0, so it makes it impossible to find a single version of the AWS provider.

ah ok thanks anton, so shall I force those other modules to use an older version? (they're the EC2 modules)

Yes, I think it would be easier than trying to use both version 3 and version 4 together in the same project as described here.

Version 3 could be installed under another alias and passed into this module, like this (I didn't try this):

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.69"
      configuration_aliases = [ aws.ancient ]
    }
  }
}

provider "aws" {
  alias  = "ancient"
  region = "us-west-2"
}

module "s3_playbooks" {
  source = "terraform-aws-modules/s3-bucket/aws"
  version = "2.14.1"

  providers = {
    aws = aws.ancient
  }
}
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.69"
      configuration_aliases = [ aws.ancient ]
    }
  }
}

even this is not working.. still gettig error
image

image

I am using aws = { version = "~> 3.69" }

Terraform_version = ">= 0.14"

Getting these warnings -
β”‚ Warning: Argument is deprecated
β”‚
β”‚ with module.s3Bucket.aws_s3_bucket.this,
β”‚ on .terraform/modules/main.tf line 7, in resource "aws_s3_bucket" "this":
β”‚ 7: resource "aws_s3_bucket" "this" {
β”‚
β”‚ Use the aws_s3_bucket_website_configuration resource instead
β”‚
β”‚ (and 13 more similar warnings elsewhere)

β•΅

Hello, can we get an update please on the status of this? I would very much like to upgrade to provider version 4

This issue has been resolved in version 3.0.0 πŸŽ‰

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.