Created
March 13, 2024 18:20
-
-
Save rssnyder/4446ab9c96f6bf60e044560332e5f44a to your computer and use it in GitHub Desktop.
create harness azure ccm connectors for every subscription in your azure tenant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
azurerm = { | |
source = "hashicorp/azurerm" | |
version = "=3.0.0" | |
} | |
harness = { | |
source = "harness/harness" | |
} | |
} | |
} | |
provider "azurerm" { | |
features {} | |
} | |
data "azurerm_subscriptions" "available" {} | |
resource "harness_platform_connector_azure_cloud_cost" "subscription" { | |
for_each = { for subscription in data.azurerm_subscriptions.available.subscriptions : subscription.subscription_id => subscription } | |
identifier = replace(each.value.subscription_id, "-", "_") | |
name = each.value.display_name | |
features_enabled = ["VISIBILITY", "OPTIMIZATION"] | |
tenant_id = each.value.tenant_id | |
subscription_id = each.value.subscription_id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment