Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field ExpressionEvaluationOptions to set expression evaluation scope while using nested template for azurerm_resource_group_template_deployment #9723

Closed
neil-yechenwei opened this issue Dec 7, 2020 · 2 comments

Comments

@neil-yechenwei
Copy link
Contributor

neil-yechenwei commented Dec 7, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently, when using a nested template, azurerm_resource_group_template_deployment cannot specify whether template expressions are evaluated within the scope of the parent template or the nested template. So we have to add this new property ExpressionEvaluationOptions to support this scenario.

New or Affected Resource(s)

  • azurerm_resource_group_template_deployment

Potential Terraform Configuration

resource "azurerm_resource_group_template_deployment" "example" {
  name                = "acctest-deployment-example"
  resource_group_name = azurerm_resource_group.example.name
  deployment_mode     = "Complete"

  template_content = <<TEMPLATE
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {},
  "variables": {},
  "resources": []
}
TEMPLATE

  expression_evaluation_option {
    scope = "Outer"
  }
}

References

The property link: https://github.com/Azure/azure-sdk-for-go/blob/c760106e3c564f57cd7d264c872bc5ef324c592f/services/resources/mgmt/2020-06-01/resources/models.go#L727

@neil-yechenwei
Copy link
Contributor Author

neil-yechenwei commented Feb 2, 2021

The "ExpressionEvaluationOptions" property isn't in use. After confirmed with service team, we have to set ""expressionEvaluationOptions": { "scope": "inner" }," in template content to enable ExpressionEvaluationOptions. So we don't need to implement the "ExpressionEvaluationOptions" property.

Related reference:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/linked-templates?tabs=azure-powershell#expression-evaluation-scope-in-nested-templates

@ghost
Copy link

ghost commented Mar 5, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant