Skip to content

AWS provider version 4.0.0 issues: How do I lock the version in the Reference Architecture (or Terragrunt for that matter)? #187

Pinned Answered by yorinasub17
yorinasub17 asked this question in Help
Discussion options

You must be logged in to vote

You can work around this by using an override file in the generate block. The following generate block is confirmed to properly lock the version and work around this error. You can add this to the root terragrunt.hcl file to ensure all your modules use the 3.x series of the aws provider.

# Use an override file to lock the provider version, regardless of if required_providers is defined in the modules.
generate "provider_version" {
  path      = "provider_version_override.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}
EOF
}

Note that you may have to remove the .…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yorinasub17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
1 participant