Skip to content

Commit 76061bd

Browse files
SSPROD-49726 - add(oracle): provider alias (#3)
* add(oracle): provider alias * add(oracle): provider alias
1 parent 3a25e15 commit 76061bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/onboarding/main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ data "oci_identity_compartment" "compartment" {
1212
id = var.compartment_ocid
1313
}
1414

15+
// tenancy data if onboarding a tenancy
16+
data "oci_identity_tenancy" "tenancy" {
17+
count = var.compartment_ocid == "" ? 1 : 0
18+
tenancy_id = var.tenancy_ocid
19+
}
20+
1521

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

5259
component {
5360
type = "COMPONENT_SERVICE_PRINCIPAL"

0 commit comments

Comments
 (0)