2024-10-14 13:56:33 -07:00

44 lines
1.0 KiB
HCL

resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_pet" "azurerm_container_group_name" {
prefix = "cont"
}
resource "azurerm_container_group" "example" {
name = "${random_pet.azurerm_container_group_name.id}-examplecont"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
ip_address_type = "Public"
dns_name_label = "${random_pet.azurerm_container_group_name.id}-examplecont"
os_type = "Linux"
container {
name = "hw"
image = "mcr.microsoft.com/azuredocs/aci-helloworld:latest"
cpu = "0.5"
memory = "1.5"
ports {
port = 80
protocol = "TCP"
}
}
container {
name = "sidecar"
image = "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar"
cpu = "0.5"
memory = "1.5"
}
tags = {
environment = "testing"
}
}