-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
panic when external changes cause a different expansion during apply #36184
Comments
Hi @abaddon82, thanks for filing this! I think this is the same root cause as #35863, but we don't have a reliable reproduction yet. Maybe we can reproduce this using your config. A couple of questions:
Thanks! |
@liamcervante : it's part of a larger deploy, but I'll see if I can pull out the relevant stuff! ETA: yes, it happens every time I run the workflow (this is run as part of a GitHub workflow) |
Hi @abaddon82, There are a few oddities I can't explain yet in the logs, but the first thing that jumps out is the Can you show a little more of the configuration that is going into the |
Here's the relevant info: variable "landing_zones_common_config_file" {
description = "somethingsomething"
type = string
default = "../config/v1/standard.config.json"
}
locals {
landing_zone_types = [
for landing_zone_type_file in fileset(var.landing_zone_type_directory, "**/*.json") : jsondecode(file("${var.landing_zone_type_directory}/${landing_zone_type_file}"))
]
landing_zone_common_config = jsondecode(file(var.landing_zones_common_config_file))
}
module "landing_zone_type_repositories" {
source = "./github_repo"
for_each = { for lzt in local.landing_zone_types : "lzt-${lzt.repository}" => lzt }
repo_name = "lzt-${each.value.repository}"
} The JSON document just looks like this: {
"repository": "containercluster"
} |
An important note that I've managed to verify now: this code only causes TF to crash when run in a GitHub Actions workflow. When I run the code on my own system, it works fine. The GitHub Actions workflow runs in a ubuntu-latest environment, while my own system runs on Windows 10. Both using Terraform version 1.10.2. |
@abaddon82, got it! The failing This then causes a mismatch between the configuration and the plan, where |
Nice work! |
While terraform takes a config snapshot to prevent this type of change during apply, that can't capture external files like those loaded via Here's the error and stack trace to make this more searchable:
|
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/abaddon82/3b0320f6cc82ee811c8a11f2d2c74480
Expected Behavior
Array of GitHub repositories should be created/configured.
Actual Behavior
Application crash.
Steps to Reproduce
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: