Thank you for your post and I apologize for the delayed response! To hopefully help point you in the right direction, I'll share my findings based off your Terraform script and error messages below.
Error Message 1:
Error: Unsupported attribute on main.tf line 2, in locals: 2: key_vault_name = coalesce(var.key_vault_name, module.solution_settings.key_vault_name) module.solution_settings is a object. This object does not have an attribute named "key_vault_name".
This error message indicates that the object module.solution_settings
doesn't have an attribute named "key_vault_name". This suggests that the key_vault_name
variable is not defined in the solution_settings
module.
- When looking into your
variables.tf
file of thesolution_settings
module, it looks like you set the defaultkey_vault_name
variable as an empty string. Can you make sure that thekey_vault_name
variable within theModule Solutionsettings
was correctly set? - I notice you're trying to set it to
key_vault_name = "${local.name_prefix}akv"
Error Message 2:
Error: Invalid value for input variable on solutionsettings.tf line 4, in module "solution_settings": 4: solution_name = "testmm" The given value is not suitable for module.solution_settings.var.solution_name declared at solutionsettings\variables.tf:1,1-25: map of any single type required.
The second error indicates that the solution_name
variable is not the correct type. The solution_name
variable is defined as a map of any single type, but the value provided (testmm
) is a string.
- Can you make sure you used the correct value or type when it comes to the
solution_name
variable?
Error Message 3:
Error: Invalid value for variable │ │ on solutionsettings.tf line 10, in module "solution_settings": │ 10: tags....
The last error message is regarding issues with the tags
variable. When referencing our Microsoft.KeyVault vaults Terraform script, I noticed that each tag is written with an "equals =" sign but within your Terraform script you're using a "colon :".
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
- Can you ensure that the tag values are correct and see if updating the sign value helps to resolve this error?
Additional Links:
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.