Skip to content

devwithkrishna/azure-container-registry-terraform-module

Repository files navigation

azure-container-registry-creation-repo

Azure Container Registry (ACR) is a managed Docker container registry service provided by Microsoft Azure. It allows developers to store, manage, and deploy container images and artifacts securely in the cloud. ACR integrates seamlessly with Azure services, enabling continuous integration and continuous deployment (CI/CD) workflows for containerized applications. Additionally, it supports features like geo-replication, automated image builds, and integration with Azure Active Directory for enhanced security and access control.

Requirements

Name Version
terraform ~> 1.3
azurerm <= 4.0

Usage

Basic usage of this module is as follows:

  module "example" {
    	 source  = "<module-path>"
    
   # Required variables
    	 container_registry_config  = 
    
   # Optional variables
    	 application_name  = "devwithkrishna"
    	 azure_services_bypass  = "AzureServices"
    	 container_registry_name  = ""
    	 environment  = "DEV"
    	 georeplications  = []
    	 location  = ""
    	 resource_group_name  = ""
    	 sku_name  = "Basic"
    	 temporary  = "TRUE"
  }

Resources

Name Type
azurerm_container_registry.acr resource
azurerm_resource_group.acr_rg resource

Inputs

Name Description Type Required
application_name Azure application name tag string no
azure_services_bypass Whether to allow trusted Azure services to access a network restricted Container Registry? Possible values are None and AzureServices. Defaults to AzureServices string no
container_registry_config Manages an Azure Container Registry object({ admin_enabled = optional(bool) quarantine_policy_enabled = optional(bool) zone_redundancy_enabled = optional(bool) public_network_access_enabled = optional(bool) retention_policy_in_days = optional(number) trust_policy_enabled = optional(bool) anonymous_pull_enabled = optional(bool) data_endpoint_enabled = optional(bool) }) yes
container_registry_name Azure container registry name string no
environment Environment tag value in Azure string no
georeplications A list of Azure locations where the container registry should be geo-replicated list(object({ location = string zone_redundancy_enabled = optional(bool) })) no
location Azure container registry location string no
resource_group_name Azure container registry Rg string no
sku_name Container registry SKUs available in Azure. Valid options are Basic, Standard or Premium string no
temporary Temporary tag value in Azure string no

Outputs

Name Description
acr_admin_enabled Admin user is enabled for acr or not
acr_admin_password Password associated with the Container Registry Admin account - if the admin account is enabled
acr_admin_username Username associated with the Container Registry Admin account - if the admin account is enabled
acr_anonymous_pull_enabled Anonymous pull is enabled on ACR or not
acr_login_server The URL that can be used to log into the container registry
acr_rg Azure container registry RG
container_registry_name Azure container registry name