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

fix: remove ibm_iam_account_settings from da #751

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions solutions/secure-cross-regional-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,22 @@ locals {
}]
}


#######################################################################################################################
# KMS Key
#######################################################################################################################

data "ibm_iam_account_settings" "iam_account_settings" {
count = local.create_cross_account_auth_policy ? 1 : 0
provider = ibm.cos
module "cos_crn_parser" {
source = "terraform-ibm-modules/common-utilities/ibm//modules/crn-parser"
version = "1.1.0"
crn = var.existing_cos_instance_id
}

# Create IAM Authorization Policy to allow COS to access KMS for the encryption key
resource "ibm_iam_authorization_policy" "cos_kms_policy" {
count = local.create_cross_account_auth_policy ? 1 : 0
provider = ibm.kms
source_service_account = data.ibm_iam_account_settings.iam_account_settings[0].account_id
source_service_account = module.cos_crn_parser.account_id
source_service_name = "cloud-object-storage"
source_resource_instance_id = local.cos_instance_guid
target_service_name = local.kms_service_name
Expand Down
9 changes: 5 additions & 4 deletions solutions/secure-regional-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ locals {
#######################################################################################################################
# KMS Key
#######################################################################################################################
data "ibm_iam_account_settings" "iam_account_settings" {
count = local.create_cross_account_auth_policy ? 1 : 0
provider = ibm.cos
module "cos_crn_parser" {
source = "terraform-ibm-modules/common-utilities/ibm//modules/crn-parser"
version = "1.1.0"
crn = var.existing_cos_instance_id
}

# Create IAM Authorization Policy to allow COS to access KMS for the encryption key
resource "ibm_iam_authorization_policy" "cos_kms_policy" {
count = local.create_cross_account_auth_policy ? 1 : 0
provider = ibm.kms
source_service_account = data.ibm_iam_account_settings.iam_account_settings[0].account_id
source_service_account = module.cos_crn_parser.account_id
source_service_name = "cloud-object-storage"
source_resource_instance_id = local.cos_instance_guid
target_service_name = local.kms_service_name
Expand Down