From 9d154a15d337b299ffac6cced74aac90ece49edd Mon Sep 17 00:00:00 2001 From: Sivaanand Murugesan Date: Wed, 6 Dec 2023 09:44:08 +0530 Subject: [PATCH] PLT-866: Added support for credential type secret for OCI registry and backup storage (#81) * PLT-866: Added support for credential type scret for OCI registry and backup storage * removed default value in cred type --- spectro-registry.tf | 6 ++++-- spectro-s3-sts-backup.tf | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spectro-registry.tf b/spectro-registry.tf index ba03348..00106d2 100644 --- a/spectro-registry.tf +++ b/spectro-registry.tf @@ -15,8 +15,10 @@ resource "spectrocloud_registry_oci" "oci_registry" { is_private = true credentials { credential_type = each.value.credential_type - arn = each.value.arn - external_id = each.value.external_id + arn = try(each.value.arn, "") + external_id = try(each.value.external_id, "") + access_key = try(each.value.access_key, "") + secret_key = try(each.value.secret_key, "") } } diff --git a/spectro-s3-sts-backup.tf b/spectro-s3-sts-backup.tf index 1479d84..01dbfd3 100644 --- a/spectro-s3-sts-backup.tf +++ b/spectro-s3-sts-backup.tf @@ -21,8 +21,10 @@ resource "spectrocloud_backup_storage_location" "bsl" { region = each.value.region bucket_name = each.value.bucket_name s3 { - credential_type = "sts" - arn = each.value.arn - external_id = each.value.external_id + credential_type = each.value.credential_type + arn = try(each.value.arn, "") + external_id = try(each.value.external_id, "") + access_key = try(each.value.access_key, "") + secret_key = try(each.value.secret_key, "") } } \ No newline at end of file