-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathmain.tf
More file actions
41 lines (37 loc) · 1.04 KB
/
Copy pathmain.tf
File metadata and controls
41 lines (37 loc) · 1.04 KB
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
33
34
35
36
37
38
39
40
41
resource "alicloud_instance" "instance" {
security_groups = alicloud_security_group.group.*.id
instance_type = "ecs.e-c1m1.large"
image_id = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
vswitch_id = alicloud_vswitch.vswitch.id
system_disk_size = 40
system_disk_category = "cloud_essd"
instance_name = "huocorp_terraform_goat_instance"
depends_on = [
alicloud_security_group.group,
alicloud_vswitch.vswitch
]
}
resource "alicloud_security_group" "group" {
name = "huocorp_terraform_goat_security_group"
vpc_id = alicloud_vpc.vpc.id
depends_on = [
alicloud_vpc.vpc
]
}
resource "alicloud_vswitch" "vswitch" {
vpc_id = alicloud_vpc.vpc.id
cidr_block = "172.16.0.0/24"
zone_id = "cn-beijing-h"
vswitch_name = "huocorp_terraform_goat_vswitch"
depends_on = [
alicloud_vpc.vpc
]
}
resource "alicloud_vpc" "vpc" {
vpc_name = "huocorp_terraform_goat_vpc"
cidr_block = "172.16.0.0/16"
}
data "alicloud_instance_types" "types_ds" {
cpu_core_count = 1
memory_size = 1
}