2
2
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
3
3
#
4
4
5
- # File Version: 0.7.1
5
+ # File Version: 0.1.0
6
6
7
7
# Dependencies:
8
- # - module-oci-networking.tf file
9
- # - module-defaults.tf file
8
+ # - terraform-oci-networking module
10
9
11
10
# ###############################################################################
12
11
# If you have extra configurations to add, you can add them here.
16
15
# - Extra route tables and security lists
17
16
# ###############################################################################
18
17
18
+ # ###############################################################################
19
+ # Deployment Defaults
20
+ # ###############################################################################
21
+ locals {
22
+ deploy_id = random_string. deploy_id . result
23
+ deploy_tags = { " DeploymentID" = local.deploy_id, " AppName" = local.app_name, " Quickstart" = " oke_base" }
24
+ oci_tag_values = {
25
+ " freeformTags" = merge (var. tag_values . freeformTags , local. deploy_tags ),
26
+ " definedTags" = var.tag_values.definedTags
27
+ }
28
+ app_name = var. app_name
29
+ app_name_normalized = substr (replace (lower (local. app_name ), " " , " -" ), 0 , 6 )
30
+ app_name_for_dns = substr (lower (replace (local. app_name , " /\\ W|_|\\ s/" , " " )), 0 , 6 )
31
+ }
32
+
33
+ resource "random_string" "deploy_id" {
34
+ length = 4
35
+ special = false
36
+ }
37
+
19
38
# ###############################################################################
20
39
# Required locals for the oci-networking and oke modules
21
40
# ###############################################################################
@@ -28,6 +47,21 @@ locals {
28
47
route_tables = concat (local. route_tables_oke )
29
48
security_lists = concat (local. security_lists_oke )
30
49
resolved_vcn_compartment_ocid = (var. create_new_compartment_for_oke ? local. oke_compartment_ocid : var. compartment_ocid )
50
+ pre_vcn_cidr_blocks = split (" ," , var. vcn_cidr_blocks )
51
+ vcn_cidr_blocks = contains (module. vcn . cidr_blocks , local. pre_vcn_cidr_blocks [0 ]) ? distinct (concat ([local . pre_vcn_cidr_blocks [0 ]], module. vcn . cidr_blocks )) : module. vcn . cidr_blocks
52
+ network_cidrs = {
53
+ VCN-MAIN-CIDR = local.vcn_cidr_blocks[0 ] # e.g.: "10.20.0.0/16" = 65536 usable IPs
54
+ ENDPOINT-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 12 , 0 ) # e.g.: "10.20.0.0/28" = 15 usable IPs
55
+ NODES-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 6 , 3 ) # e.g.: "10.20.12.0/22" = 1021 usable IPs (10.20.12.0 - 10.20.15.255)
56
+ LB-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 6 , 4 ) # e.g.: "10.20.16.0/22" = 1021 usable IPs (10.20.16.0 - 10.20.19.255)
57
+ FSS-MOUNT-TARGETS-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 10 , 81 ) # e.g.: "10.20.20.64/26" = 62 usable IPs (10.20.20.64 - 10.20.20.255)
58
+ APIGW-FN-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 8 , 30 ) # e.g.: "10.20.30.0/24" = 254 usable IPs (10.20.30.0 - 10.20.30.255)
59
+ VCN-NATIVE-POD-NETWORKING-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 1 , 1 ) # e.g.: "10.20.128.0/17" = 32766 usable IPs (10.20.128.0 - 10.20.255.255)
60
+ BASTION-REGIONAL-SUBNET-CIDR = cidrsubnet (local. vcn_cidr_blocks [0 ], 12 , 32 ) # e.g.: "10.20.2.0/28" = 15 usable IPs (10.20.2.0 - 10.20.2.15)
61
+ PODS-CIDR = " 10.244.0.0/16"
62
+ KUBERNETES-SERVICE-CIDR = " 10.96.0.0/16"
63
+ ALL-CIDR = " 0.0.0.0/0"
64
+ }
31
65
}
32
66
33
67
# ###############################################################################
0 commit comments