oracle-terraform-modules/terraform-oci-oke

Add Support for Resource Manager

MarcGueury opened this issue ยท 4 comments

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The same works without OCI Resource Manager.

I am not able to use the module with Resource Manager due to 2 reasons:

  1. when using the module as a reference to my yaml file. There is this error:

The local name "oci.home" in the root module represents provider hashicorp/oci", but ""oci.home"" in module.oke represents ""oracle/oci".

  1. when downloading the full repository and applying it, there is this error:

-> Invalid Terraform version specified in the Terraform configuration file: >= 1.3.0. Update the configuration file to specify a supported Terraform version.

The max version of Resource Manager seems to be 1.2.x...

New or Affected Resource(s)

Potential Terraform Configuration

variable "tenancy_id" {}
variable "region" {}
variable "compartment_id" {}

terraform {
  required_version = ">=1.2.0"
  required_providers {
    oci = {
      source  = "oracle/oci"
    }
  }
}

provider "oci" {
  alias        = "home2"
  auth         = "SecurityToken"
  config_file_profile = "DEFAULT"
  region       = var.region
}

module "oke" {
  source  = "oracle-terraform-modules/oke/oci"
  version = "5.1.0"

  home_region = var.region
  region      = var.region
  ssh_private_key_path = "/home/opc/data/lz/tfok2/ssh_key_starter"
  ssh_public_key_path = "/home/opc/data/lz/tfok2/ssh_key_starter.pub"

  tenancy_id = var.tenancy_id

  # general oci parameters
  compartment_id = var.compartment_id

  worker_disable_default_cloud_init = true
  bastion_allowed_cidrs       = [ "0.0.0.0/0" ]

  providers = {
    oci.home = oci.home2
  }
}

I can upload also a zip file that fails if it helps.

tfok2.zip
Upload this file in OCI Resource Manager and it will fail...

This module is using features available in terraform starting with version 1.3.0. If you are looking for a deployment through ORM, you can use this source: https://github.com/robo-cap/terraform-oci-oke/tree/sav

module "oke" {
  source  = "git::https://github.com/robo-cap/terraform-oci-oke.git?ref=205e509"
...
}

The current latest Terraform version available for ORM is 1.2.0.

Thanks, forgot to say that there is a WA (thanks Alberto) it is to use a branch for 1.2 like this:

module "oke" {
  source  = "github.com/oracle-terraform-modules/terraform-oci-oke.git?ref=5.x-tf12&depth=1"
  providers      = { oci.home = oci.home }
  tenancy_id = var.tenancy_ocid
  compartment_id = var.compartment_ocid

  # Identity
  create_iam_resources = false
  create_iam_tag_namespace = false
  create_iam_defined_tags = false
  use_defined_tags = false
  ...

Then it works perfectly.

Resolved in #907