-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathmain.tf
32 lines (28 loc) · 931 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Create VPC and Subnet
resource "tencentcloud_vpc" "example" {
name = "example"
cidr_block = "10.0.0.0/16"
}
resource "tencentcloud_subnet" "example" {
name = "example"
availability_zone = var.availability_zone
vpc_id = tencentcloud_vpc.example.id
cidr_block = "10.0.0.0/24"
is_multicast = false
}
resource "tencentcloud_ha_vip" "example" {
name = "example"
vpc_id = tencentcloud_vpc.example.id
subnet_id = tencentcloud_subnet.example.id
vip = "10.0.20.5"
}
resource "tencentcloud_ha_vip_eip_attachment" "example" {
havip_id = tencentcloud_ha_vip.example.id
address_ip = tencentcloud_eip.example.public_ip
}
data "tencentcloud_ha_vips" "example" {
id = tencentcloud_ha_vip.example.id
}
data "tencentcloud_ha_vip_eip_attachments" "example" {
havip_id = tencentcloud_ha_vip_eip_attachment.example.havip_id
}