Skip to content

Commit

Permalink
deploy user assigned managed identity (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl authored Jan 5, 2024
1 parent 1546f91 commit 4d586c6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
5 changes: 4 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.4.4 |
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.4.5 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.3.0 |
| <a name="module_statuscake-tls-monitor"></a> [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.2 |

Expand Down Expand Up @@ -194,6 +194,9 @@ No resources.
| <a name="input_mssql_server_admin_password"></a> [mssql\_server\_admin\_password](#input\_mssql\_server\_admin\_password) | The local administrator password for the MSSQL server | `string` | `""` | no |
| <a name="input_mssql_server_public_access_enabled"></a> [mssql\_server\_public\_access\_enabled](#input\_mssql\_server\_public\_access\_enabled) | Enable public internet access to your MSSQL instance. Be sure to specify 'mssql\_firewall\_ipv4\_allow\_list' to restrict inbound connections | `bool` | `false` | no |
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes |
| <a name="input_registry_admin_enabled"></a> [registry\_admin\_enabled](#input\_registry\_admin\_enabled) | Do you want to enable access key based authentication for your Container Registry? | `bool` | `true` | no |
| <a name="input_registry_managed_identity_assign_role"></a> [registry\_managed\_identity\_assign\_role](#input\_registry\_managed\_identity\_assign\_role) | Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `false` | no |
| <a name="input_registry_use_managed_identity"></a> [registry\_use\_managed\_identity](#input\_registry\_use\_managed\_identity) | Create a User-Assigned Managed Identity for the Container App. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `true` | no |
| <a name="input_statuscake_api_token"></a> [statuscake\_api\_token](#input\_statuscake\_api\_token) | API token for StatusCake | `string` | `"00000000000000000000000000000"` | no |
| <a name="input_statuscake_contact_group_email_addresses"></a> [statuscake\_contact\_group\_email\_addresses](#input\_statuscake\_contact\_group\_email\_addresses) | List of email address that should receive notifications from StatusCake | `list(string)` | `[]` | no |
| <a name="input_statuscake_contact_group_integrations"></a> [statuscake\_contact\_group\_integrations](#input\_statuscake\_contact\_group\_integrations) | List of Integration IDs to connect to your Contact Group | `list(string)` | `[]` | no |
Expand Down
7 changes: 5 additions & 2 deletions terraform/container-apps-hosting.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "azure_container_apps_hosting" {
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.4.4"
source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.4.5"

environment = local.environment
project_name = local.project_name
Expand All @@ -8,7 +8,10 @@ module "azure_container_apps_hosting" {

virtual_network_address_space = local.virtual_network_address_space

enable_container_registry = local.enable_container_registry
enable_container_registry = local.enable_container_registry
registry_admin_enabled = local.registry_admin_enabled
registry_use_managed_identity = local.registry_use_managed_identity
registry_managed_identity_assign_role = local.registry_managed_identity_assign_role

image_name = local.image_name
image_tag = local.image_tag
Expand Down
3 changes: 3 additions & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ locals {
tags = var.tags
virtual_network_address_space = var.virtual_network_address_space
enable_container_registry = var.enable_container_registry
registry_admin_enabled = var.registry_admin_enabled
registry_use_managed_identity = var.registry_use_managed_identity
registry_managed_identity_assign_role = var.registry_managed_identity_assign_role
image_name = var.image_name
image_tag = var.image_tag
container_command = var.container_command
Expand Down
18 changes: 18 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ variable "image_name" {
type = string
}

variable "registry_admin_enabled" {
description = "Do you want to enable access key based authentication for your Container Registry?"
type = bool
default = true
}

variable "registry_use_managed_identity" {
description = "Create a User-Assigned Managed Identity for the Container App. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity"
type = bool
default = true
}

variable "registry_managed_identity_assign_role" {
description = "Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity"
type = bool
default = false
}

variable "container_command" {
description = "Container command"
type = list(any)
Expand Down

0 comments on commit 4d586c6

Please sign in to comment.