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 have set up Git integration on the Semaphore server and added the repositories where I have the Terraform files (main, tfvars, etc.). In the tfvars file, I have added the variables that will be used when Terraform is launched. When I configure the environment variables in the 'Environment Variables' section, they are applied without issues and execute the ones I have modified instead of the default ones in the tfvars file (desired behavior).
The problem arises when I try to modify variables of type 'map of string,' where I encounter the following error: 'add screenshot.'
I have tried adding them as JSON in the environment variables and also in table form, but I have not been able to get them to work in any case. For this type of variable, it uses the default values in the template.
If I run the Terraform task without modifying the variables of type "map of string," it executes correctly using the default values from the tfvars file.
The Terraform files in the Git repositories are 'templates' to be launched later with the modifications made from Semaphore, so it is crucial to be able to modify these map of string fields.
What am I doing wrong? Is there any way to pass this type of variable?
Example of JSON configuration in environment variables:
Davacg
changed the title
Question: use map of strings variables on Terraform from Semaphore
Question: How to use map of strings variables on Terraform from Semaphore
Dec 12, 2024
Question
I have set up Git integration on the Semaphore server and added the repositories where I have the Terraform files (main, tfvars, etc.). In the tfvars file, I have added the variables that will be used when Terraform is launched. When I configure the environment variables in the 'Environment Variables' section, they are applied without issues and execute the ones I have modified instead of the default ones in the tfvars file (desired behavior).
The problem arises when I try to modify variables of type 'map of string,' where I encounter the following error: 'add screenshot.'
I have tried adding them as JSON in the environment variables and also in table form, but I have not been able to get them to work in any case. For this type of variable, it uses the default values in the template.
If I run the Terraform task without modifying the variables of type "map of string," it executes correctly using the default values from the tfvars file.
The Terraform files in the Git repositories are 'templates' to be launched later with the modifications made from Semaphore, so it is crucial to be able to modify these map of string fields.
What am I doing wrong? Is there any way to pass this type of variable?
Example of JSON configuration in environment variables:
{
"region": "eu-west-1",
"vpc_id": "vpc-xxxxxxx",
"create_instance_sg": "true",
"instance_key_name": "keypair-semaphore-test",
"instance_type": "t2.micro",
"instance_name": "ec2-semaphore-test",
"instance_subnet_id": "subnet-xxxxx",
"tags": {
"Department": "E-02000"
}
}
Related to
No response
The text was updated successfully, but these errors were encountered: