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

Support terraform-provider-aws 4.x #137

Closed
mgerlach opened this issue Feb 11, 2022 · 16 comments · Fixed by #139
Closed

Support terraform-provider-aws 4.x #137

mgerlach opened this issue Feb 11, 2022 · 16 comments · Fixed by #139

Comments

@mgerlach
Copy link

mgerlach commented Feb 11, 2022

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

@dzzun-ops
Copy link

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

@kleytonhsantos
Copy link

kleytonhsantos commented Feb 11, 2022

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

@jdiebold
Copy link

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.

@mgerlach
Copy link
Author

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

@antonbabenko
Copy link
Member

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

@antonbabenko
Copy link
Member

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

@ghost
Copy link

ghost commented Feb 20, 2022

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

@ghost
Copy link

ghost commented Feb 20, 2022

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

@antonbabenko
Copy link
Member

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.

@ghost
Copy link

ghost commented Feb 20, 2022

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

@antonbabenko
Copy link
Member

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
  }
}

@rjshrjndrn
Copy link

rjshrjndrn commented Mar 2, 2022

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

even this is not working.. still gettig error
image

image

@goural
Copy link

goural commented Mar 21, 2022

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)

@pfilbin90
Copy link

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

@antonbabenko
Copy link
Member

This issue has been resolved in version 3.0.0 🎉

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
8 participants