variable "metadata" {
description = "metadata provides an entry point for users to further restrict policies"
type = any
default = {
"emr_runtimerole_arn" = []
}
}
#For some reason the resource block is returning empty value. for loop in resource block is not evaluating. Below is snippet from tf plan
Sorry i may not have been clear. Below is how variables.tf looks
variable "metadata" {
description = "metadata provides an entry point for users to further restrict policies"
type = any
default = {
"emr_runtimerole_arn" = ["arn:aws:iam::account_number:role/abcd/abcd3/rolename"]
}
}
for below i am trying to evaluate a list with for like above , since its not working i had to use this hack.
%{ if metadata.emr_runtimerole_arn != "" }
hope this clarifies your questions. thanks for helping out.
My sincere apologies @maxb , i wouldn’t be able to share terraform code due to ownership issue. But let me ask a different request. Would you be able to provide me sample code “for loop” in template(similar to policy.tpl) which works for a below variable?
variable "metadata" {
type = any
default = {
"runtimerole_arn" = ["arn:aws:iam::account_number:role/abcd/abcd3/rolename"]
}
}