In main.tf
I used below code to create subscription in Azure ENV
data "azurerm_billing_enrollment_account_scope" "example" {
billing_account_name = "1234567890"
enrollment_account_name = "0123456"
}
resource "azurerm_subscription" "example" {
subscription_name = "My Example EA Subscription"
billing_scope_id = data.azurerm_billing_enrollment_account_scope.example.id
}
in code when I try to add management group, using
resource "azurerm_management_group_subscription_association" "example" {
management_group_id = data.azurerm_management_group.example.id
subscription_id = resource.azurerm_subscription.example.id
}
I am getting error that cannot parse subscription with ID **.
I tried
subscription_id = resource.azurerm_subscription.example.id
subscription_id = resource.azurerm_subscription.example.subscription_id
subscription_id = azurerm_subscription.example.id
subscription_id = azurerm_subscription.example.subscription_id
used data blocks also but not successful. Do you know what I am missing