-
Notifications
You must be signed in to change notification settings - Fork 15
/
data.tf
38 lines (33 loc) · 1.04 KB
/
data.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
data "cloudinit_config" "nat_instance_init" {
gzip = true
base64_encode = true
part {
content_type = "text/x-shellscript"
content = templatefile("${path.module}/files/setup_nat.sh", {})
}
part {
content_type = "text/x-shellscript"
content = templatefile("${path.module}/files/setup_bastion.sh", {
ssh_keys = local.ssh_keys,
setup_bastion = var.setup_bastion,
bastion_user = var.bastion_user,
bastion_group = var.bastion_group
})
}
}
data "oci_core_vnic_attachments" "nat_instance_vnics" {
depends_on = [
oci_core_instance.nat_instance
]
compartment_id = var.compartment_ocid
availability_domain = var.availability_domain
instance_id = oci_core_instance.nat_instance.id
}
data "oci_core_private_ips" "nat_instance_private_ips_by_nic" {
depends_on = [
oci_core_instance.nat_instance
]
ip_address = oci_core_instance.nat_instance.private_ip
subnet_id = var.public_subnet_id
vnic_id = data.oci_core_vnic_attachments.nat_instance_vnics.vnic_id
}