File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ The following resources are used by this module:
53
53
- [ azurerm_kubernetes_cluster.k8s] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster ) (resource)
54
54
- [ azurerm_kubernetes_cluster_node_pool.additional] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster_node_pool ) (resource)
55
55
- [ azurerm_public_ip.public-ip-outbound] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip ) (resource)
56
+ - [ azurerm_role_assignment.aksacr] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment ) (resource)
56
57
- [ azuread_group.ownersgroup] ( https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group ) (data source)
57
58
58
59
## Required Inputs
@@ -143,6 +144,14 @@ Type: `list(number)`
143
144
144
145
Default: ` [] `
145
146
147
+ ### azure\_ container\_ registry\_ ids
148
+
149
+ Description: IDs of the azure container registries that the AKS should have pull access to
150
+
151
+ Type: ` list(string) `
152
+
153
+ Default: ` [] `
154
+
146
155
### default\_ node\_ pool\_ name
147
156
148
157
Description: Name of the default node pool
Original file line number Diff line number Diff line change
1
+ resource "azurerm_role_assignment" "aksacr" {
2
+ for_each = var. azure_container_registry_ids
3
+ principal_id = azurerm_kubernetes_cluster. k8s . kubelet_identity [0 ]. object_id
4
+ role_definition_name = " AcrPull"
5
+ scope = each. value
6
+ skip_service_principal_aad_check = true
7
+ }
Original file line number Diff line number Diff line change @@ -180,4 +180,12 @@ variable "managed_identity_security_group" {
180
180
* Group.Read.All
181
181
* Group.ReadWrite.All
182
182
EOF
183
+ }
184
+
185
+ variable "azure_container_registry_ids" {
186
+ type = list (string )
187
+ default = []
188
+ description = <<- EOF
189
+ IDs of the azure container registries that the AKS should have pull access to
190
+ EOF
183
191
}
You can’t perform that action at this time.
0 commit comments