Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit e9f2ba0

Browse files
committed
Fix for deploying to existing VCN & Subnets
1 parent ddbdc6d commit e9f2ba0

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

modules/network/outputs.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
output "vcn-id" {
2-
value = "${oci_core_vcn.cloudera_vcn.0.id}"
2+
value = "${var.useExistingVcn ? var.myVcn : oci_core_vcn.cloudera_vcn.0.id}"
33
}
44

55
output "private-id" {
6-
value = "${oci_core_subnet.private.0.id}"
6+
value = "${var.useExistingVcn ? var.clusterSubnet : oci_core_subnet.private.0.id}"
77
}
88

99
output "public-id" {
10-
value = "${oci_core_subnet.public.0.id}"
10+
value = "${var.useExistingVcn ? var.utilitySubnet : oci_core_subnet.public.0.id}"
1111
}
1212

1313
output "bastion-id" {
14-
value = "${oci_core_subnet.bastion.0.id}"
14+
value = "${var.useExistingVcn ? var.bastionSubnet : oci_core_subnet.bastion.0.id}"
1515
}
1616

1717
output "blockvolume-id" {
18-
value = "${oci_core_subnet.blockvolume.0.id}"
18+
value = "${var.useExistingVcn ? var.blockvolumeSubnet : oci_core_subnet.blockvolume.0.id}"
1919
}

modules/network/variables.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ variable "public_cidr" {}
2525
variable "private_cidr" {}
2626
variable "blockvolume_cidr" {}
2727
variable "enable_secondary_vnic" {}
28+
variable "myVcn" {}
29+
variable "clusterSubnet" {
30+
default = " "
31+
}
32+
variable "bastionSubnet" {
33+
default = " "
34+
}
35+
variable "utilitySubnet" {
36+
default = " "
37+
}
38+
variable "blockvolumeSubnet" {
39+
default = " "
40+
}
2841
# ---------------------------------------------------------------------------------------------------------------------
2942
# Optional variables
3043
# You can modify these.

network.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ module "network" {
2828
blockvolume_cidr = "${var.blockvolume_cidr}"
2929
custom_vcn = ["${var.myVcn}"]
3030
enable_secondary_vnic = "${var.enable_secondary_vnic}"
31+
clusterSubnet = "${var.clusterSubnet}"
32+
bastionSubnet = "${var.bastionSubnet}"
33+
utilitySubnet = "${var.utilitySubnet}"
34+
blockvolumeSubnet = "${var.blockvolumeSubnet}"
35+
myVcn = "${var.myVcn}"
3136
}

0 commit comments

Comments
 (0)