Fix multi zone setup

This commit is contained in:
Serge Logvinov
2022-02-01 16:45:42 +02:00
parent cd2ddd4849
commit fd19f484a1
6 changed files with 12 additions and 7 deletions

5
oracle/init/Makefile Normal file
View File

@@ -0,0 +1,5 @@
init:
terraform init
terraform apply -target=null_resource.terraform_key -auto-approve
terraform apply -auto-approve

View File

@@ -7,7 +7,6 @@ provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = "~/.oci/oci_api_key.pem"
private_key_path = var.key_file
region = var.region
}

View File

@@ -2,6 +2,7 @@
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "key_file" {}
variable "region" {
description = "the OCI region where resources will be created"
type = string

View File

@@ -3,7 +3,7 @@ terraform {
required_providers {
oci = {
source = "hashicorp/oci"
version = "4.57.0"
version = "4.61.0"
}
}
}

View File

@@ -135,8 +135,8 @@ resource "oci_core_subnet" "public" {
resource "oci_core_subnet" "private" {
for_each = { for idx, ad in local.zones : ad => idx }
cidr_block = cidrsubnet(oci_core_vcn.main.cidr_block, 8, each.value + 4)
ipv6cidr_block = cidrsubnet(oci_core_vcn.main.ipv6cidr_blocks[0], 8, each.value + 11)
cidr_block = cidrsubnet(oci_core_vcn.main.cidr_block, 8, each.value + 8)
ipv6cidr_block = cidrsubnet(oci_core_vcn.main.ipv6cidr_blocks[0], 8, each.value + 16)
compartment_id = var.compartment_ocid
vcn_id = oci_core_vcn.main.id
route_table_id = oci_core_route_table.private.id

View File

@@ -4,7 +4,7 @@ variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "key_file" {
default = "~/.oci/oci_public.pem"
default = "~/.oci/oci_main_terraform_public.pem"
}
variable "project" {