Closed nanaones closed 2 years ago
now result :
terraform {
required_version = "1.1.2"
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.70.0"
}
}
}
terraform official document, example
want to be :
terraform {
required_version = ">= 1.1.2"
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.70.0"
}
}
}
Hi @nanaones, A value of version flag accepts any string literal. You can pass a version constraint as it is:
before
terraform {
required_version = "1.1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.70.0"
}
}
}
$ tfupdate terraform -v ">= 1.1.2" main.tf
after
terraform {
required_version = ">= 1.1.2"
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.70.0"
}
}
}
Give it a try!
Worked for me! Suggest to update the readme
@simonweil Thank you for your suggestion. I mentioned it explicitly in README.
First of all, thank you for making such a wonderful tool.
When updating using tfupdate, all required_versions are set to "=" first. It's problematic to use as it bypasses backward compatibility in some situations.
Is there a way to force the user to select the equal sign part? Are there any updates planned for this part?