-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #877 from terraform-providers/f-container-dnslabel
Added dns_name_label and FQDN properties to container group resource.
- Loading branch information
Showing
9 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
resource "azurerm_resource_group" "aci-rg" { | ||
name="aci-test" | ||
location="west us" | ||
name = "${var.resource_group_name}" | ||
location = "${var.resource_group_location}" | ||
} | ||
|
||
resource "azurerm_container_group" "aci-test" { | ||
name = "my-aci-hw" | ||
location = "${azurerm_resource_group.aci-rg.location}" | ||
resource_group_name = "${azurerm_resource_group.aci-rg.name}" | ||
ip_address_type="public" | ||
os_type = "linux" | ||
#an attempt to keep the aci container group name (an dns label) somewhat omunique | ||
resource "random_integer" "random_int" { | ||
min = 100 | ||
max = 999 | ||
} | ||
|
||
resource "azurerm_container_group" "aci-example" { | ||
name = "my-aci-cg-${random_integer.random_int.result}" | ||
location = "${azurerm_resource_group.aci-rg.location}" | ||
resource_group_name = "${azurerm_resource_group.aci-rg.name}" | ||
ip_address_type = "public" | ||
dns_name_label = "my-aci-cg-${random_integer.random_int.result}" | ||
os_type = "linux" | ||
|
||
container { | ||
name = "hw" | ||
image = "microsoft/aci-helloworld:latest" | ||
cpu ="0.5" | ||
memory = "1.5" | ||
port = "80" | ||
name = "hw" | ||
image = "microsoft/aci-helloworld:latest" | ||
cpu = "0.5" | ||
memory = "1.5" | ||
port = "80" | ||
} | ||
|
||
container { | ||
name = "sidecar" | ||
image = "microsoft/aci-tutorial-sidecar" | ||
cpu="0.5" | ||
memory="1.5" | ||
name = "sidecar" | ||
image = "microsoft/aci-tutorial-sidecar" | ||
cpu = "0.5" | ||
memory = "1.5" | ||
} | ||
|
||
tags { | ||
environment = "testing" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
output "ip_address" { | ||
value = "${azurerm_container_group.aci-example.ip_address}" | ||
} | ||
|
||
#the dns fqdn of the container group if dns_name_label is set | ||
output "fqdn" { | ||
value = "${azurerm_container_group.aci-example.fqdn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
variable "resource_group_name" { | ||
type = "string" | ||
description = "Name of the azure resource group." | ||
default = "aci-test" | ||
} | ||
|
||
variable "resource_group_location" { | ||
type = "string" | ||
description = "Location of the azure resource group." | ||
default = "westus" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
output "ip_address" { | ||
value = "${azurerm_container_group.aci-example.ip_address}" | ||
} | ||
|
||
#the dns fqdn of the container group if dns_name_label is set | ||
output "fqdn" { | ||
value = "${azurerm_container_group.aci-example.fqdn}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
variable "resource_group_name" { | ||
type = "string" | ||
description = "Name of the azure resource group." | ||
default = "aci-test" | ||
} | ||
|
||
variable "resource_group_location" { | ||
type = "string" | ||
description = "Location of the azure resource group." | ||
default = "westus" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters