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
resource"azuredevops_variable_group""azure-tf-uat" {
project_id=var.infra_analytics_project_idname="azure-tf-uat"description="Secrets and variables for Terraform to manage the Azure infra in the UAT subscription"allow_access=falsedynamic"variable" {
for_each=var.azure_tf_uat_var_groupiterator=ci_var
content {
name=ci_var.keyvalue=ci_var.value
}
}
dynamic"variable" {
for_each=var.azure_tf_uat_secret_groupiterator=ci_secret
content {
name=ci_secret.keyvalue=ci_secret.valuesecret_value=ci_secret.valueis_secret=true
}
}
}
also tested without secret_value or without value.
@mikemowgli I cannot reproduce your error.
Can you use output "secret_val" { value = azuredevops_variable_group.azure-tf-uat } print the created resource and check if Terraform uses the correct value?
Test script:
variable "azure_tf_uat_secret_group" {
type = list(object({
name = string
secret_val = string
}))
default = [
{
name = "key1"
secret_val = "val1"
},
{
name = "key2"
secret_val = "val2"
}
]
}
resource "azuredevops_variable_group" "azure-tf-uat" {
project_id = data.azuredevops_project.adotest.id
name = "azure-tf-uat"
description = "Secrets and variables for Terraform to manage the Azure infra in the UAT subscription"
allow_access = false
dynamic "variable" {
for_each = var.azure_tf_uat_secret_group
iterator = ci_secret
content {
name = ci_secret.value.name
secret_value = ci_secret.value.secret_val
is_secret = true
}
}
// variable {
// name = "test"
// value = "test"
// secret_value = "test"
// is_secret = true
// }
}
output "val" {
value = azuredevops_variable_group.azure-tf-uat
}
output "config" {
value = var.azure_tf_uat_secret_group
}
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v0.13.3
Affected Resource(s)
azuredevops_variable_group
Terraform Configuration Files
secret_value
or withoutvalue
.Debug Output
https://gist.github.com/mikemowgli/44afe35764b1ab8465d82c619e36e372
Expected Behavior
terraform apply succeeds and secret variables are populated in Azure Devops variable group
Actual Behavior
terraform apply succeeds but secrets are empty
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: