-
Notifications
You must be signed in to change notification settings - Fork 118
This allows the user to specify an existing VCN instead of it being created #171
base: master
Are you sure you want to change the base?
Conversation
docs/input-variables.md
Outdated
@@ -112,6 +112,7 @@ The following input variables are used to configure the inbound security rules o | |||
name | default | description | |||
------------------------------------|-------------------------|------------ | |||
network_cidrs | See map in variables.tf | A CIDR notation IP range of the VCN and its subnets. | |||
network_subnet_dns | See map in variables.tf | A DNS label for each of the subnet in the VCN (Max 15 characters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A DNS label for each of the subnet in the VCN => A DNS label for each of the subnets in the VCN
k8s-oci.tf
Outdated
@@ -31,10 +16,29 @@ module "k8s-tls" { | |||
### Virtual Cloud Network | |||
|
|||
module "vcn" { | |||
create_vcn = "${var.vcn_id == "" ? 1 : 0}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clever since the value is used later but from reading the code it feels like this should be a boolean and the later expressions later should reference it
count = "${var.create_vcn ? "1" : "0"}"
The above feels more consistent with how count is derived elsewhere in the code i.e in resource "oci_core_route_table" "NATInstanceAD1RouteTable"
This looks good to me; certainly works. Do we need more docs around the constraints of using it with an existing VCN?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to also handle the case where the user only has the use
permission, which prevents them from creating subnets (or security lists, or route tables), but allows them to launch instances.
This is probably more common than the case of knowing the destination VCN but not already having the Subnets ready.
@tjfontaine I've moved this to a new feature request. #178 where we can discuss this new requirement. |
I add the new variables in the tfvar files but new vcn still created. Thanks, |
Is this feature ready for me to use? I tried it yesterday and it did not work. should I try it again? Thanks, |
simple specify the 3 extra parameters
VCN
vcn_id = "ocid1.vcn.oc1.phx.aaaaaaaa545hjqe26s77xpiiuyznb6baxym5ff6lnx5asgggnptwfcg3t7na"
dhcp_options_id = "ocid1.dhcpoptions.oc1.phx.aaaaaaaat27e4e6li545u4tnymwk7452gpxvqcszg6jbflpfqvtr7vkxjqnq"
public_routetable_id = "ocid1.routetable.oc1.phx.aaaaaaaab5obbsciewyf73r4ggm26uvmykqbyhwphwqiuvqpune3bosoyey