Skip to content

Commit

Permalink
remove ability to set container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
nhudson committed Oct 16, 2024
1 parent 299966b commit 98b80fd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ locals {
}
}
}

52 changes: 26 additions & 26 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
module "avm_res_containerregistry_registry" {
for_each = toset(var.acr == null ? [] : ["acr"])
source = "Azure/avm-res-containerregistry-registry/azurerm"
version = "0.3.1"
name = var.acr.name
location = var.location
resource_group_name = var.resource_group_name
sku = "Premium"
public_network_access_enabled = false
private_endpoints = {
primary = {
private_dns_zone_resource_ids = var.acr.private_dns_zone_resource_ids
subnet_resource_id = var.acr.subnet_resource_id
}
}
}

resource "azurerm_role_assignment" "acr" {
for_each = toset(var.acr == null ? [] : ["acr"])

principal_id = azurerm_kubernetes_cluster.this.kubelet_identity[0].object_id
scope = module.avm_res_containerregistry_registry["acr"].resource_id
role_definition_name = "AcrPull"
skip_service_principal_aad_check = true
}
# module "avm_res_containerregistry_registry" {
# for_each = var.create_acr ? toset(["acr"]) : toset([])
# source = "Azure/avm-res-containerregistry-registry/azurerm"
# version = "0.3.1"
# name = var.acr.name
# location = var.location
# resource_group_name = var.resource_group_name
# sku = "Premium"
# public_network_access_enabled = false
# private_endpoints = {
# primary = {
# private_dns_zone_resource_ids = var.acr.private_dns_zone_resource_ids
# subnet_resource_id = var.acr.subnet_resource_id
# }
# }
# }
#
# resource "azurerm_role_assignment" "acr" {
# for_each = var.create_acr ? toset(["acr"]) : toset([])
#
# principal_id = azurerm_kubernetes_cluster.this.kubelet_identity[0].object_id
# scope = module.avm_res_containerregistry_registry[0].resource_id
# role_definition_name = "AcrPull"
# skip_service_principal_aad_check = true
# }

resource "azurerm_user_assigned_identity" "aks" {
count = length(var.managed_identities.user_assigned_resource_ids) > 0 ? 0 : 1
Expand Down Expand Up @@ -67,7 +67,7 @@ resource "azurerm_kubernetes_cluster" "this" {
workload_identity_enabled = true

api_server_access_profile {
authorized_ip_ranges = var.api_server_authorized_ip_ranges
authorized_ip_ranges = var.api_server_authorized_ip_ranges
}

default_node_pool {
Expand Down
25 changes: 15 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,21 @@ variable "resource_group_name" {
nullable = false
}

variable "acr" {
type = object({
name = string
private_dns_zone_resource_ids = set(string)
subnet_resource_id = string

})
default = null
description = "(Optional) Parameters for the Azure Container Registry to use with the Kubernetes Cluster."
}
# variable "create_acr" {
# type = bool
# description = "Whether to create an Azure Container Registry"
# }
#
# variable "acr" {
# type = object({
# name = string
# private_dns_zone_resource_ids = set(string)
# subnet_resource_id = string
#
# })
# default = null
# description = "(Optional) Parameters for the Azure Container Registry to use with the Kubernetes Cluster."
# }

variable "agents_tags" {
type = map(string)
Expand Down

0 comments on commit 98b80fd

Please sign in to comment.