Skip to content
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

Compatibility with Terraform 1.10 #3604

Open
djacquensf9 opened this issue Nov 27, 2024 · 8 comments · May be fixed by #3605
Open

Compatibility with Terraform 1.10 #3604

djacquensf9 opened this issue Nov 27, 2024 · 8 comments · May be fixed by #3605
Labels
contributions-requested Requesting contributions from the community enhancement New feature or request good first issue Good for newcomers preserved Preserved issues never go stale

Comments

@djacquensf9
Copy link

djacquensf9 commented Nov 27, 2024

Hi,

Describe the enhancement

Terraform 1.10 was released two hours ago and Terragrunt is not yet compatible with this version !!

Two hours !! What are you doing, guys ?! 🤣

Thanks, ;)

David

@djacquensf9 djacquensf9 added the enhancement New feature or request label Nov 27, 2024
@denis256
Copy link
Member

denis256 commented Nov 27, 2024

Hi,
the new Terraform 1.10 introduces changes in input/plan handling and S3 configuration behavior, which have caused multiple Terragrunt tests to fail.

If you'd like to contribute fixes or insights, we’d greatly appreciate your support. Contributions from the community play a significant role in making updates faster and smoother.

Example failing tests:
TestAutoRetryGetDefaultErrors
TestTerragruntWorksWithIncludeDeepMerge
TestTerragruntWorksWithMultipleInclude
TestSopsDecryptedCorrectly
TestSopsDecryptedCorrectlyRunAll
TestInputsPassedThroughCorrectly
TestDependencyMockOutputMergeStrategyWithStateCompatTrue
TestDependencyMockOutputMergeStrategyWithStateCompatConflict
TestDependencyMockOutputMergeStrategyWithStateShallow
TestDependencyMockOutputMergeStrategyWithStateDeepMapOnly
TestDependencyOutputTypeConversion
TestReadTerragruntConfigWithDependency
TestStorePlanFilesRunAllPlanApply
TestStorePlanFilesRunAllPlanApplyRelativePath
TestTerragruntRunAllPlanAndShow
TestTerragruntWorksWithMultipleInclude/deep-merge-nonoverlapping
TestTerragruntWorksWithMultipleInclude/deep-merge-overlapping
TestTerragruntWorksWithMultipleInclude/expose
TestTerragruntWorksWithMultipleInclude/has-bare-include
TestTerragruntWorksWithMultipleInclude/json
TestAwsSopsDecryptedKMSCorrectly

Reference PR
#3605

@denis256 denis256 added contributions-requested Requesting contributions from the community good first issue Good for newcomers preserved Preserved issues never go stale labels Nov 27, 2024
@ricardoleal
Copy link

ricardoleal commented Nov 28, 2024

For now i'm getting the following

  ╷
  │ Error: Can't change variable when applying a saved plan

  │ The variable asg_capacity cannot be set using the -var and -var-file
  │ options when applying a saved plan file, because a saved plan includes the
  │ variable values that were set when it was created. The saved plan specifies
  │ "{\"desired_capacity\":1,\"max_size\":1,\"min_size\":1}" as the value
  │ whereas during apply the value object with 3 attributes was set by an
  │ environment variable. To declare an ephemeral variable which is not saved
  │ in the plan file, use ephemeral = true.
➜  terragrunt --version
terragrunt version v0.69.2
➜  terraform --version 
Terraform v1.10.0
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.78.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.5

Update with terraform and terragrunt versions

Issue on hashicorp for reference : hashicorp/terraform#36106

@joshbsemperis
Copy link

Experiencing the same, seems like quite a serious issue, its a breaking change

@ricardoleal
Copy link

ricardoleal commented Dec 4, 2024

For now i'm getting the following

  ╷
  │ Error: Can't change variable when applying a saved plan

  │ The variable asg_capacity cannot be set using the -var and -var-file
  │ options when applying a saved plan file, because a saved plan includes the
  │ variable values that were set when it was created. The saved plan specifies
  │ "{\"desired_capacity\":1,\"max_size\":1,\"min_size\":1}" as the value
  │ whereas during apply the value object with 3 attributes was set by an
  │ environment variable. To declare an ephemeral variable which is not saved
  │ in the plan file, use ephemeral = true.
➜  terragrunt --version
terragrunt version v0.69.2
➜  terraform --version 
Terraform v1.10.0
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.78.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.5

Update with terraform and terragrunt versions

Issue on hashicorp for reference : hashicorp/terraform#36106

Issue solved with https://github.com/hashicorp/terraform/releases/tag/v1.10.1

Tested new backend with s3 state lock and working.

remote_state {
  backend = "s3"
  config = {
    bucket         = "xxxxx-bucket"
    key            = format("%s/terraform.tfstate", get_path_from_repo_root())
    region         = "eu-west-3"
    encrypt        = true
    dynamodb_table = "xxxxxx-db-table"
    use_lockfile   = true
  }
}

result

aws s3 cp s3://xxxxx-bucket/terraform.tfstate.tflock - | jq .
{
  "ID": "ee0b3c54-de6a-d4ca-d0a6-52f5298ed7c9",
  "Operation": "OperationTypeApply",
  "Info": "",
  "Who": "xxxx@device",
  "Version": "1.10.1",
  "Created": "2024-12-04T16:54:05.570709Z",
  "Path": "xxxxx-bucket/terraform.tfstate"
}

@denis256 denis256 linked a pull request Dec 4, 2024 that will close this issue
4 tasks
@liangrog
Copy link

liangrog commented Dec 5, 2024

Terraform has released 1.10.1 for the fix. Could we please bump the version up to the same for Terragrunt docker container? Thanks.

@yhakbar
Copy link
Collaborator

yhakbar commented Dec 5, 2024

Hey folks,

We're still seeing failures in our CI testing the integration with 1.10.1 related to applying stored plans (the three failing tests are TestTerragruntRunAllPlanAndShow, TestStorePlanFilesRunAllPlanApplyRelativePath and TestStorePlanFilesRunAllPlanApply if interested).

We won't bump the officially supported version until it passes CI.

@yhakbar
Copy link
Collaborator

yhakbar commented Dec 13, 2024

The recent release of 1.10.2 seems to have a release note related to fixing applying plans, so I'm re-running integration tests on that version.

@yhakbar
Copy link
Collaborator

yhakbar commented Dec 13, 2024

Still seeing failures in CI:

TestStorePlanFilesRunAllPlanApply:

* Failed to execute "terraform apply -auto-approve -input=false /tmp/TestStorePlanFilesRunAllPlanApply3764107339/001/app/tfplan.tfplan" in /tmp/terragrunt-test857549231/fixtures/out-dir/app
Error: Can't change variable when applying a saved plan
The variable input_value cannot be set using the -var and -var-file options
when applying a saved plan file, because a saved plan includes the variable
values that were set when it was created. The saved plan specifies "42" as
the value whereas during apply the value "46521694" was set by an
environment variable. To declare an ephemeral variable which is not saved
in the plan file, use ephemeral = true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions-requested Requesting contributions from the community enhancement New feature or request good first issue Good for newcomers preserved Preserved issues never go stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants