Skip to content

Commit

Permalink
fix: Add perms for ingress to update the public subnet as well (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshg authored Oct 4, 2023
1 parent f790dd9 commit 959c50f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module "app_aks" {
location = azurerm_resource_group.default.location

gateway = module.app_lb.gateway
public_subnet = module.networking.public_subnet
cluster_subnet_id = module.networking.private_subnet.id

tags = var.tags
Expand Down
6 changes: 6 additions & 0 deletions modules/app_aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ resource "azurerm_role_assignment" "resource_group" {
role_definition_name = "Reader"
principal_id = local.ingress_gateway_principal_id
}

resource "azurerm_role_assignment" "gateway" {
scope = var.public_subnet.id
role_definition_name = "Contributor"
principal_id = local.ingress_gateway_principal_id
}
4 changes: 4 additions & 0 deletions modules/app_aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ variable "gateway" {
type = object({ id = string })
}

variable "public_subnet" {
type = object({ id = string })
}

variable "tags" {
default = {}
type = map(string)
Expand Down

0 comments on commit 959c50f

Please sign in to comment.