Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSPROD-49726 - add(oracle): provider alias #3

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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