Open jayendranarumugam opened 3 years ago
This is a huge problem for a system I work with. We are heavy users of Management groups and this collides with System Assigned MI's (SAMI). Assigning a policy with SAMI on a high management group level requires the SAMI to be assigned in the scope where the resource is. Easily this prorogates to 150+ direct role assignments on the resource it self, which is a challenge given only 2000 Role assignments are supported on RG level.
Hi
I have a declaration as below but get an error when apply. In other places it seems that I can use the Azure Subscription GUID as subscription_id but not here why?
variable sub_hub_we { description = "The Hub Subscription" type = string default = "4c19dd9e-b3c3-4ae2-a639-4dd4373a843c" } provider "azurerm" { alias = "provider-sub-hub-we" subscription_id = var.sub_hub_we tenant_id = var.azure-tenant-id features {} } resource "azurerm_subscription_policy_assignment" "az-keyvault-dispub1" { name = "az-keyvault-dispub" display_name = data.azurerm_policy_definition.az-keyvault-dispub.display_name policy_definition_id = data.azurerm_policy_definition.az-keyvault-dispub.id subscription_id = var.sub_hub_we #Not working enforce = true }
Gives the Error:
Error: "subscription_id" expected to be valid subscription ID, got "4c19dd9e-b3c3-4ae2-a639-4dd4373a843c"
on builtin-policies.tf line 238, in resource "azurerm_subscription_policy_assignment" "az-keyvault-dispub1": 238: subscription_id = var.sub_hub_we #Not working
See this was added in 4 months ago on the 2021-06-01 Resource - Would require upgrading the API version thats being used - hopefully can be done without any breaking changes but have only had a 5 minute look over
https://github.com/Azure/azure-rest-api-specs/pull/15181
This appears to be in preview package for policy, although likely need a RP Request for latest stable - but they appear the same (see https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01)
For the RP - Items in both 2021-06-01 Stable and 2019-09-01 stable API appear the same so shouldn't be any issues
Put up an RP for having 2021-06-01 in stable as well https://github.com/Azure/azure-sdk-for-go/issues/16389
Duplicate of #13443.
It appears the Map enum isnt marked as read only in API but children are which is quite confusing, but this is blocked until API is fixed
Community Note
Description
New or Affected Resource(s)
Potential Terraform Configuration
Current behaviour
Currently only system managed identity can able to pass as a parameter
References
0