-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvsi.tf
37 lines (33 loc) · 1.03 KB
/
vsi.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
resource "ibm_is_vpc" "vpc" {
name = "test-vpc"
}
resource "ibm_is_subnet" "subnet" {
name = "test-subnet"
vpc = ibm_is_vpc.vpc.id
zone = "us-south-2"
total_ipv4_address_count = 16
}
resource "ibm_is_instance" "instance" {
name = "test-instance"
image = data.ibm_is_image.this.id
profile = "bx2-2x8"
metadata_service_enabled = true
default_trusted_profile_target = "Profile-XXXXXXXX-aXXa-4XX1-8XX2-0XXXXXXXXXX5"
primary_network_interface {
subnet = ibm_is_subnet.testacc_subnet.id
security_groups = [ibm_is_vpc.vpc.default_security_group]
}
user_data = data.template_cloudinit_config.config.rendered
vpc = ibm_is_vpc.vpc.id
zone = ibm_is_subnet.subnet.zone
keys = [data.ibm_is_ssh_key.sshkey.id]
}
data "template_cloudinit_config" "config" {
gzip = false
base64_encode = false
part {
filename = "init-shellscript"
content_type = "text/x-shellscript"
content = templatefile("cloudinit_completion_check.sh", { trustedprofile = "Profile-XXXXX" })
}
}