terraform: fix syntax in Azure example due to deprecated tf resource arguments (#17497)

This commit is contained in:
Dao Thanh Tung
2023-06-19 17:26:14 +08:00
committed by GitHub
parent 219f5dd532
commit e29ad68c58

View File

@@ -38,7 +38,7 @@ resource "azurerm_subnet" "hashistack-sn" {
name = "hashistack-sn"
resource_group_name = "${azurerm_resource_group.hashistack.name}"
virtual_network_name = "${azurerm_virtual_network.hashistack-vn.name}"
address_prefix = "10.0.2.0/24"
address_prefixes = ["10.0.2.0/24"]
}
resource "azurerm_network_security_group" "hashistack-sg" {
@@ -100,7 +100,7 @@ resource "azurerm_public_ip" "hashistack-server-public-ip" {
name = "hashistack-server-ip-${count.index}"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.hashistack.name}"
public_ip_address_allocation = "static"
allocation_method = "Static"
}
resource "azurerm_network_interface" "hashistack-server-ni" {
@@ -117,7 +117,7 @@ resource "azurerm_network_interface" "hashistack-server-ni" {
public_ip_address_id = "${element(azurerm_public_ip.hashistack-server-public-ip.*.id, count.index)}"
}
tags {
tags = {
ConsulAutoJoin = "auto-join"
}
}
@@ -166,8 +166,7 @@ resource "azurerm_virtual_machine" "server" {
data "template_file" "user_data_server" {
template = "${file("${path.root}/user-data-server.sh")}"
vars {
vars = {
server_count = "${var.server_count}"
retry_join = "${var.retry_join}"
}
@@ -178,7 +177,7 @@ resource "azurerm_public_ip" "hashistack-client-public-ip" {
name = "hashistack-client-ip-${count.index}"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.hashistack.name}"
public_ip_address_allocation = "static"
allocation_method = "Static"
}
resource "azurerm_network_interface" "hashistack-client-ni" {
@@ -195,7 +194,7 @@ resource "azurerm_network_interface" "hashistack-client-ni" {
public_ip_address_id = "${element(azurerm_public_ip.hashistack-client-public-ip.*.id, count.index)}"
}
tags {
tags = {
ConsulAutoJoin = "auto-join"
}
}
@@ -245,8 +244,7 @@ resource "azurerm_virtual_machine" "client" {
data "template_file" "user_data_client" {
template = "${file("${path.root}/user-data-client.sh")}"
vars {
vars = {
retry_join = "${var.retry_join}"
}
}