-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalibaba_vm_machine.tf
46 lines (38 loc) · 1.25 KB
/
alibaba_vm_machine.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
provider "alicloud" {
access_key = "Your keys"
secret_key = "Your Sec keys"
region = "us-west-1"
}
variable "name" {
default = "auto_provisioning_group"
}
resource "alicloud_security_group" "group" {
name = "tf_test_foo"
description = "foo"
vpc_id = alicloud_vpc.vpc.id
}
data "alicloud_zones" "default" {
available_disk_category = "cloud_efficiency"
available_resource_creation = "VSwitch"
}
resource "alicloud_vpc" "vpc" {
name = var.name
cidr_block = "172.16.0.0/16"
}
resource "alicloud_vswitch" "vswitch" {
vpc_id = alicloud_vpc.vpc.id
cidr_block = "172.16.0.0/24"
zone_id = data.alicloud_zones.default.zones[0].id
vswitch_name = var.name
}
resource "alicloud_instance" "instance" {
security_groups = alicloud_security_group.group.*.id
instance_type = "ecs.hfc6.large"
system_disk_category = "cloud_efficiency"
system_disk_name = "test_foo_system_disk_name"
system_disk_description = "test_foo_system_disk_description"
image_id = "ubuntu_20_04_x64_20G_alibase_20211027.vhd"
instance_name = "test_foo"
vswitch_id = alicloud_vswitch.vswitch.id
internet_max_bandwidth_out = 10
}