0

This is a follow-up to The provider hashicorp/aws does not support resource type "aws_internet_gateway_attachment".

The crux of it is, I'm using 3.75.1 of the AWS provider, and I need to upgrade. How do I do that?

I got the version by reading the .terraform.lock.hcl

provider "registry.terraform.io/hashicorp/aws" {
  version     = "3.75.1"

1 Answer 1

1

Upgrading to the newest version

You can upgrade the provider with

terraform init -upgrade

So long as you don't have the version specified anywhere in a required_providers block.

Pinning with a required_providers block

You can pin or specify any arbitrary version constraint with a required_providers block, like this.

terraform {
  required_providers {
    aws = {
      source = "registry.terraform.io/hashicorp/aws"
      version = "4.14.0"
    }
  }
}
provider "aws" {
  region = "us-east-1"
}

Terraform pre 0.13

Prior to Terraform version 0.13, you could specify your version in the provider block,

provider "aws" {
  version = "4.14.0"
  region = "us-east-1"
}

Find the official docs at,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.