Azure module to generate a Container instances group.
Module version | Terraform version | AzureRM version |
---|---|---|
>= 7.x.x | 1.3.x | >= 3.0 |
>= 6.x.x | 1.x | >= 3.0 |
>= 5.x.x | 0.15.x | >= 2.0 |
>= 4.x.x | 0.13.x / 0.14.x | >= 2.0 |
>= 3.x.x | 0.12.x | >= 2.0 |
>= 2.x.x | 0.12.x | < 2.0 |
< 2.x.x | 0.11.x | < 2.0 |
If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.
More details are available in the CONTRIBUTING.md file.
This module is optimized to work with the Claranet terraform-wrapper tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the terraform-wrapper
available in the documentation.
module "azure_region" {
source = "claranet/regions/azurerm"
version = "x.x.x"
azure_region = var.azure_region
}
module "rg" {
source = "claranet/rg/azurerm"
version = "x.x.x"
location = module.azure_region.location
client_name = var.client_name
environment = var.environment
stack = var.stack
}
module "logs" {
source = "claranet/run/azurerm//modules/logs"
version = "x.x.x"
client_name = var.client_name
environment = var.environment
stack = var.stack
location = module.azure_region.location
location_short = module.azure_region.location_short
resource_group_name = module.rg.resource_group_name
}
module "acr" {
source = "claranet/acr/azurerm"
version = "x.x.x"
location = module.azure_region.location
location_short = module.azure_region.location_short
resource_group_name = module.rg.resource_group_name
sku = "Standard"
client_name = var.client_name
environment = var.environment
stack = var.stack
logs_destinations_ids = [
module.logs.logs_storage_account_id,
module.logs.log_analytics_workspace_id
]
extra_tags = {
foo = "bar"
}
}
module "aci" {
source = "claranet/aci/azurerm"
version = "x.x.x"
location = module.azure_region.location
location_short = module.azure_region.location_short
client_name = var.client_name
environment = var.environment
stack = var.stack
resource_group_name = module.rg.resource_group_name
restart_policy = "OnFailure"
containers_config = [
{
name = "aci-example"
image = "${module.acr.login_server}/samples/nginx:latest"
cpu = 1
memory = 2
ports = [{
port = 80
protocol = "TCP"
}]
}
]
registry_credential = {
username = module.acr.admin_username
password = module.acr.admin_password
server = module.acr.login_server
}
logs_destinations_ids = [
module.logs.logs_storage_account_id,
module.logs.log_analytics_workspace_id
]
extra_tags = {
foo = "bar"
}
}
Name | Version |
---|---|
azurecaf | ~> 1.2, >= 1.2.22 |
azurerm | ~> 3.71 |
Name | Source | Version |
---|---|---|
diagnostics | claranet/diagnostic-settings/azurerm | ~> 6.5.0 |
Name | Type |
---|---|
azurerm_container_group.aci | resource |
azurecaf_name.aci | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
client_name | Client name/account used in naming | string |
n/a | yes |
containers_config | Containers configurations. | list(object({ |
n/a | yes |
custom_diagnostic_settings_name | Custom name of the diagnostics settings, name will be 'default' if not set. | string |
"default" |
no |
custom_name | Custom Azure Container Instances group name, generated if not set | string |
"" |
no |
default_tags_enabled | Option to enable or disable default tags. | bool |
true |
no |
dns_config | DNS configuration to apply to containers. | object({ |
null |
no |
dns_name_label | ACI Custom DNS name label used when container is public. | string |
null |
no |
dns_name_label_reuse_policy | The value representing the security enum. Noreuse, ResourceGroupReuse, SubscriptionReuse, TenantReuse or Unsecure. Defaults to Unsecure. | string |
"Unsecure" |
no |
environment | Project environment | string |
n/a | yes |
extra_tags | Additional tags to associate with your Azure Container Instances group. | map(string) |
{} |
no |
identity | Map with identity block information. | object({ |
{} |
no |
init_containers | initContainer configuration. | list(object({ |
[] |
no |
location | Azure region to use | string |
n/a | yes |
location_short | Short string for Azure location | string |
n/a | yes |
logs_categories | Log categories to send to destinations. | list(string) |
null |
no |
logs_destinations_ids | List of destination resources IDs for logs diagnostic destination. Can be Storage Account , Log Analytics Workspace and Event Hub . No more than one of each can be set.If you want to specify an Azure EventHub to send logs and metrics to, you need to provide a formated string with both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the ` |
` character. | list(string) |
n/a |
logs_metrics_categories | Metrics categories to send to destinations. | list(string) |
null |
no |
name_prefix | Optional prefix for the generated name | string |
"" |
no |
name_suffix | Optional suffix for the generated name | string |
"" |
no |
os_type | The OS for the container group. Allowed values are Linux and Windows. Changing this forces a new resource to be created. | string |
"Linux" |
no |
registry_credential | A registry_credential object as documented below. Changing this forces a new resource to be created. | object({ |
null |
no |
resource_group_name | Name of the resource group | string |
n/a | yes |
restart_policy | Restart policy for the container group. Allowed values are Always , Never , OnFailure . Changing this forces a new resource to be created. |
string |
"Always" |
no |
stack | Project stack name | string |
n/a | yes |
subnet_ids | Subnet IDs of the private network profile of the container. Mandatory when VNet integration is enabled. |
list(string) |
null |
no |
use_caf_naming | Use the Azure CAF naming provider to generate default resource name. custom_name override this if set. Legacy default name is used if this is set to false . |
bool |
true |
no |
vnet_integration_enabled | Allow to enable Vnet integration. | bool |
false |
no |
Name | Description |
---|---|
aci_fqdn | The FQDN of the container group derived from dns_name_label . |
aci_id | Azure container instance group ID |
aci_identity_principal_id | ACI identity principal ID. |
aci_ip_address | The IP address allocated to the container instance group. |
Microsoft Azure documentation: docs.microsoft.com/en-us/azure/container-instances/container-instances-overview