-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Impossible to update to a newer terraform version if only the GitHub Action is allowed to execute terraform #335
Comments
Hello, thanks for creating an issue. The version in the Number 1 in the version discovery list relates to Terraform Cloud/Enterprise workspaces, where the remote workspace version always takes priority. This log shows the version coming from a local |
I think number 1 is inspecting my S3 remote state? Here is provider "aws" {
region = var.region
profile = "robmoss"
default_tags {
tags = {
Owner = var.owner
purpose = var.purpose
Name = "${var.owner}: ${var.purpose}"
map-migrated = "d-server-001j25bgmzlvy7"
}
}
}
provider "tls" {}
provider "http" {} There is no |
I updated the original issue to contain debug-enabled logs. |
Hold on a minute. I've uploaded the log from the wrong run. Updating again - sorry! Edited: updated with the stuff from the correct repo. From the logs, my assumption was wrong and my PR is useless. |
OK, here it is. I have this:
According to the documentation, I should have this:
However, |
That's a good find, I didn't know Terraform allowed that. |
I didn't know Terraform wasn't supposed to allow anything else! |
Version 1.42.1 has been released that allows a |
Problem description
In the documentation, it specifies the following first two points for
terraform-version
:required_version
constraint in the Terraform configuration. If the constraint is range, the latest matching version is used.We aren't allowed to execute terraform locally, as there are loads of validation steps to prevent people from breaking things that run in the GitHub Actions. Therefore, if my last terraform apply was on version
1.7.5
and I've validated I can switch to1.8.0
, the only way I can do that is to change my required_version to==1.8.0
. Butterraform-version
ignores this when installing terraform, installing version1.7.5
, and then it barfs because terraform1.7.5
won't apply whenrequired_version
is set to==1.8.0
.Suggested fix:
required_version
overrides the version in the state file if it's newer.Terraform version
1.8.0
Backend
s3
Workflow YAML
Workflow log
Has debug logging been enabled?
ACTIONS_STEP_DEBUG
secret was set totrue
when capturing the workflow log above.The text was updated successfully, but these errors were encountered: