You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error when using a custom (CLI deployment) Terraform module in a .zip file:
{
"taskReports": [
{
"taskType": "EXECUTE_TERRAFORM_PLAN",
"createTime": "2024-12-02T13:50:48.023Z",
"taskExecutionStatus": "ISSUES_FOUND",
"digest": "Terraform validations failed",
"errorMessage": "Step #2 - \"Replace image variables\": Already have image (with digest): gcr.io/cloud-marketplace-tools/mpdev:v0.4.0\nStep #2 - \"Replace image variables\": Replacing the default values of the variables: [source_image]\nStep #2 - \"Replace image variables\": Mapping of values to replace: map[projects/canonical-public/global/images/ubuntu-pro-2004-focal-v20241115:projects/mpi-canonical-public/global/images/ubuntu-pro-2004-focal-v20241115]\nStep #2 - \"Replace image variables\": Error: default value: projects/canonical-public/global/images/ubuntu-pro-2204-focal-v20240910 of variable: source_image not found in replacements\n"
},
...
}
and I'm struggling to make sense of that error. With the same Terraform module, locally running terraform planterraform apply, etc. works as expected, so I'm not sure what the issue is? Running the marketplace Terrafom validations on the same module without the terraform.tfvars file also works fine, so I've narrowed the issue down to that file. However we need this file as the source_image will change every time we release a new Ubuntu Pro image.
For reference, the .zip files contains the following:
main.tf
marketplace_test.tfvars
README.md
terraform.tfvars
variables.tf
If you need any more information do let me know :)
The text was updated successfully, but these errors were encountered:
It seems that the issue is with mpdev not correctly replacing the source_image value from terraform.tfvars. While the module works locally, mpdev may not be loading the .tfvars file properly or missing the expected mapping. Manually setting source_image in mpdev or verifying the replacement mappings could help resolve this.
try running
terraform validate -var-file=terraform.tfvars ```
or can you write a debug -> variable.tf
```variable "source_image" {
description = "Source image to use"
type = string
default = "projects/canonical-public/global/images/ubuntu-pro-2204-focal-v20240910"
}
output "source_image_debug" {
value = var.source_image
}```
Hey there!
I get the following error when using a custom (CLI deployment) Terraform module in a
.zip
file:and I'm struggling to make sense of that error. With the same Terraform module, locally running
terraform plan
terraform apply
, etc. works as expected, so I'm not sure what the issue is? Running the marketplace Terrafom validations on the same module without theterraform.tfvars
file also works fine, so I've narrowed the issue down to that file. However we need this file as thesource_image
will change every time we release a new Ubuntu Pro image.For reference, the
.zip
files contains the following:main.tf
marketplace_test.tfvars
README.md
terraform.tfvars
variables.tf
If you need any more information do let me know :)
The text was updated successfully, but these errors were encountered: