Skip to content

Commit

Permalink
SSPROD-49726 - add(oracle): provider alias (#3)
Browse files Browse the repository at this point in the history
* add(oracle): provider alias

* add(oracle): provider alias
  • Loading branch information
jose-pablo-camacho authored Dec 10, 2024
1 parent 3a25e15 commit 76061bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/onboarding/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ data "oci_identity_compartment" "compartment" {
id = var.compartment_ocid
}

// tenancy data if onboarding a tenancy
data "oci_identity_tenancy" "tenancy" {
count = var.compartment_ocid == "" ? 1 : 0
tenancy_id = var.tenancy_ocid
}


// random suffix for policy name
resource "random_id" "suffix" {
Expand Down Expand Up @@ -48,6 +54,7 @@ resource "sysdig_secure_cloud_auth_account" "oracle_account" {
// when compartmentID is not specified, default to the rootCompartmentOCID which is the same value as tenancyOCID
provider_id = var.compartment_ocid == "" ? var.tenancy_ocid : var.compartment_ocid
provider_type = "PROVIDER_ORACLECLOUD"
provider_alias = var.compartment_ocid == "" ? data.oci_identity_tenancy.tenancy[0].name : data.oci_identity_compartment.compartment[0].name

component {
type = "COMPONENT_SERVICE_PRINCIPAL"
Expand Down

0 comments on commit 76061bd

Please sign in to comment.