atlantis: Specified terraform version (using required_version) not used when required_providers is specified
I have a project that I just upgraded to terraform 0.13, and that on it’s own worked fine. I then attempted to use the new syntax for specifying a provider version, and that seems to cause atlantis to be unable to parse the required_version specified in the terraform. For example, with this configuration plans are successful:
terraform {
required_version = "0.13.0"
backend "s3" {
region = "us-west-2"
bucket = "<redacted>"
key = "<redacted>"
dynamodb_table = "<redacted>"
}
}
But with this configuration:
terraform {
required_version = "0.13.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3"
}
}
backend "s3" {
region = "us-west-2"
bucket = "<redacted>"
key = "<redacted>"
dynamodb_table = "<redacted>"
}
}
The plan fails with
Warning: Provider source not supported in Terraform v0.12
on main.tf line 5, in terraform:
5: aws = {
6: source = "hashicorp/aws"
7: version = "~> 3"
8: }
A source was declared for provider aws. Terraform v0.12 does not support the
provider source attribute. It will be ignored.
Error: Unsupported Terraform Core version
This configuration does not support Terraform version 0.12.27. To proceed,
either choose another supported Terraform version or update the root module's
version constraint. Version constraints are normally set for good reason, so
updating the constraint may lead to other errors or unexpected behavior.
It seems specifying the provider info breaks required_version = "0.13.0".
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 17 (10 by maintainers)
Commits related to this issue
- Bump terraform-config-inspect to fix #1153 — committed to joerx/atlantis by joerx 6 years ago
- Bump terraform-config-inspect to fix #1153 — committed to joerx/atlantis by joerx 6 years ago
I wanted to report that this still doesnt work in the latest helm chart.
Results in
We are specifying defaultTFVersion: 0.13.3 chart, and then attempting to upgrade section by section to 0.13.5, then we would bump up the default version.
@llamahunter if you have a moment can you please make note of where in the source you found the constraint to make it easier for someone to pick up?
PRs welcome! Can someone dig into this?
I’m seeing this error message in the logs: