New sample (converted from Bicep via OpenAI)
This commit is contained in:
36
quickstart/101-aci-linuxcontainer-public-ip/main.tf
Normal file
36
quickstart/101-aci-linuxcontainer-public-ip/main.tf
Normal file
@ -0,0 +1,36 @@
|
||||
resource "random_pet" "rg_name" {
|
||||
prefix = var.resource_group_name_prefix
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "rg" {
|
||||
name = random_pet.rg_name.id
|
||||
location = var.resource_group_location
|
||||
}
|
||||
|
||||
resource "random_string" "container_name" {
|
||||
length = 25
|
||||
lower = true
|
||||
upper = false
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "azurerm_container_group" "container" {
|
||||
name = "${var.container_group_name_prefix}-${random_string.container_name.result}"
|
||||
location = azurerm_resource_group.rg.location
|
||||
resource_group_name = azurerm_resource_group.rg.name
|
||||
ip_address_type = "Public"
|
||||
os_type = "Linux"
|
||||
restart_policy = var.restart_policy
|
||||
|
||||
container {
|
||||
name = "${var.container_name_prefix}-${random_string.container_name.result}"
|
||||
image = var.image
|
||||
cpu = var.cpu_cores
|
||||
memory = var.memory_in_gb
|
||||
|
||||
ports {
|
||||
port = var.port
|
||||
protocol = "TCP"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user