Skip to content

Commit 72aba66

Browse files
Merge pull request #467 from johndowns/container-instances-zonal
Add availability zone support to Container Instances sample
2 parents 146dec5 + 7f3acea commit 72aba66

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

quickstart/101-aci-linuxcontainer-public-ip/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ resource "azurerm_container_group" "container" {
2121
ip_address_type = "Public"
2222
os_type = "Linux"
2323
restart_policy = var.restart_policy
24+
zones = var.zone != "" ? [ var.zone ] : null
2425

2526
container {
2627
name = "${var.container_name_prefix}-${random_string.container_name.result}"

quickstart/101-aci-linuxcontainer-public-ip/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This template deploys an Azure Container Instance with a public IP address.
2020
| `cpu_cores` | Quantity of CPU cores to allocate to the container. | 1 |
2121
| `memory_in_gb` | Amount of memory to allocate to the container in gigabytes. | 2 |
2222
| `restart_policy` | Behavior of Azure runtime if container has stopped. | Always |
23+
| `zone` | The availability zone to deploy the container group into. If not specified, the container group is nonzonal and might be deployed into any zone. | (empty) |
2324

2425
## Example
2526

quickstart/101-aci-linuxcontainer-public-ip/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ variable "restart_policy" {
5555
error_message = "The restart_policy must be one of the following: Always, Never, OnFailure."
5656
}
5757
}
58+
59+
variable "zone" {
60+
type = string
61+
description = "The availability zone to deploy the container group into. If not specified, the container group is nonzonal and might be deployed into any zone."
62+
default = ""
63+
}

0 commit comments

Comments
 (0)