@@ -63,7 +63,6 @@ resource "azurerm_marketplace_agreement" "kinvolk-stable2-agreement" {
6363# Data source to get the current client configuration
6464data "azurerm_client_config" "current" {}
6565
66-
6766# Resource group for CAPZ CI resources
6867resource "azurerm_resource_group" "capz_ci" {
6968 location = var. location
@@ -81,45 +80,56 @@ resource "azurerm_storage_account" "k8sprowstorage" {
8180 min_tls_version = " TLS1_0"
8281 account_replication_type = " RAGRS"
8382 cross_tenant_replication_enabled = true
84- depends_on = [azurerm_resource_group . capz_ci ]
83+ depends_on = [
84+ azurerm_resource_group . capz_ci
85+ ]
8586}
8687
87- # Import identities module
88- module "identities " {
89- source = " ./identities "
88+ # Import container registry module
89+ module "container_registry " {
90+ source = " ./container-registry "
9091 resource_group_name = var. resource_group_name
9192 location = var. location
92- depends_on = [azurerm_resource_group . capz_ci ]
93+ depends_on = [
94+ azurerm_resource_group . capz_ci
95+ ]
96+ }
97+
98+ # Import identities module
99+ module "identities" {
100+ source = " ./identities"
101+ resource_group_name = var. resource_group_name
102+ location = var. location
103+ subscription_id = data. azurerm_client_config . current . subscription_id
104+ container_registry_scope = module. container_registry . container_registry_id
105+ depends_on = [
106+ azurerm_resource_group . capz_ci
107+ ]
93108}
94109
95110# Import key vault module
96111module "key_vault" {
97- source = " ./key-vault"
98- resource_group_name = var. resource_group_name
99- location = var. location
100- tenant_id = data. azurerm_client_config . current . tenant_id
112+ source = " ./key-vault"
113+ resource_group_name = var. resource_group_name
114+ location = var. location
115+ tenant_id = data. azurerm_client_config . current . tenant_id
101116 identities = {
102- cloud_provider_user_identity_id = module.identities.cloud_provider_user_identity_id
103117 domain_vm_identity_id = module.identities.domain_vm_identity_id
104118 gmsa_user_identity_id = module.identities.gmsa_user_identity_id
105119 }
106- depends_on = [azurerm_resource_group . capz_ci ]
107- }
108-
109- # Import container registry module
110- module "container_registry" {
111- source = " ./container-registry"
112- resource_group_name = var. resource_group_name
113- location = var. location
114- depends_on = [azurerm_resource_group . capz_ci ]
120+ depends_on = [
121+ azurerm_resource_group . capz_ci
122+ ]
115123}
116124
117125# Import role assignments module
118126module "role_assignments" {
119127 source = " ./role-assignments"
120128 resource_group_name = var. resource_group_name
121129 container_registry_scope = module. container_registry . container_registry_id
122- subscription_id = data. azurerm_client_config . current . subscription_id
130+ # storage_account_scope = azurerm_storage_account.k8sprowstorage.id
131+ subscription_id = data. azurerm_client_config . current . subscription_id
132+ key_vault_id = module. key_vault . key_vault_id
123133 depends_on = [
124134 azurerm_resource_group . capz_ci ,
125135 azurerm_storage_account . k8sprowstorage ,
0 commit comments