File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
66 cloud_provider = " gcp"
77}
88
9+ data "sysdig_secure_tenant_external_id" "external_id" {}
10+
911data "google_project" "project" {
1012 project_id = var. project_id
1113}
@@ -54,7 +56,7 @@ resource "google_iam_workload_identity_pool_provider" "posture_auth_pool_provide
5456 description = " AWS identity pool provider for Sysdig Secure Data Config Posture resources"
5557 disabled = false
5658
57- attribute_condition = " attribute.aws_role==\" arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ var . external_id } \" "
59+ attribute_condition = " attribute.aws_role==\" arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ data . sysdig_secure_tenant_external_id . external_id . external_id } \" "
5860
5961 attribute_mapping = {
6062 " google.subject" = " assertion.arn" ,
@@ -81,7 +83,7 @@ resource "google_project_iam_member" "cspm" {
8183resource "google_service_account_iam_member" "custom_posture_auth" {
8284 service_account_id = google_service_account. posture_auth . name
8385 role = " roles/iam.workloadIdentityUser"
84- member = " principalSet://iam.googleapis.com/projects/${ data . google_project . project . number } /locations/global/workloadIdentityPools/${ google_iam_workload_identity_pool . posture_auth_pool . workload_identity_pool_id } /attribute.aws_role/arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ var . external_id } "
86+ member = " principalSet://iam.googleapis.com/projects/${ data . google_project . project . number } /locations/global/workloadIdentityPools/${ google_iam_workload_identity_pool . posture_auth_pool . workload_identity_pool_id } /attribute.aws_role/arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ data . sysdig_secure_tenant_external_id . external_id . external_id } "
8587}
8688
8789# --------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
66 cloud_provider = " gcp"
77}
88
9+ data "sysdig_secure_tenant_external_id" "external_id" {}
10+
911data "google_project" "project" {
1012 project_id = var. project_id
1113}
@@ -54,7 +56,7 @@ resource "google_iam_workload_identity_pool_provider" "onboarding_auth_pool_prov
5456 description = " AWS identity pool provider for Sysdig Secure Data Onboarding resources"
5557 disabled = false
5658
57- attribute_condition = " attribute.aws_role==\" arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ var . external_id } \" "
59+ attribute_condition = " attribute.aws_role==\" arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ data . sysdig_secure_tenant_external_id . external_id . external_id } \" "
5860
5961 attribute_mapping = {
6062 " google.subject" = " assertion.arn" ,
@@ -81,7 +83,7 @@ resource "google_project_iam_member" "browser" {
8183resource "google_service_account_iam_member" "custom_onboarding_auth" {
8284 service_account_id = google_service_account. onboarding_auth . name
8385 role = " roles/iam.workloadIdentityUser"
84- member = " principalSet://iam.googleapis.com/projects/${ data . google_project . project . number } /locations/global/workloadIdentityPools/${ google_iam_workload_identity_pool . onboarding_auth_pool . workload_identity_pool_id } /attribute.aws_role/arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ var . external_id } "
86+ member = " principalSet://iam.googleapis.com/projects/${ data . google_project . project . number } /locations/global/workloadIdentityPools/${ google_iam_workload_identity_pool . onboarding_auth_pool . workload_identity_pool_id } /attribute.aws_role/arn:aws:sts::${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_account_id } :assumed-role/${ data . sysdig_secure_trusted_cloud_identity . trusted_identity . aws_role_name } /${ data . sysdig_secure_tenant_external_id . external_id . external_id } "
8587}
8688
8789# ---------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ provider "sysdig" {
2020module "onboarding" {
2121 source = " ../../../modules/onboarding"
2222 project_id = " org-child-project-3"
23- external_id = " 25ef0d887bc7a2b30089a025618e1c62"
2423 is_organizational = true
2524 organization_domain = " draios.com"
2625}
2726
2827module "config-posture" {
2928 source = " ../../../modules/config-posture"
3029 project_id = module. onboarding . project_id
31- external_id = " 25ef0d887bc7a2b30089a025618e1c62"
3230 is_organizational = module. onboarding . is_organizational
3331 organization_domain = module. onboarding . organization_domain
3432 sysdig_secure_account_id = module. onboarding . sysdig_secure_account_id
Original file line number Diff line number Diff line change @@ -20,13 +20,11 @@ provider "sysdig" {
2020module "onboarding" {
2121 source = " ../../../modules/onboarding"
2222 project_id = " org-child-project-3"
23- external_id = " 25ef0d887bc7a2b30089a025618e1c62"
2423}
2524
2625module "config-posture" {
2726 source = " ../../../modules/config-posture"
2827 project_id = " org-child-project-3"
29- external_id = " 25ef0d887bc7a2b30089a025618e1c62"
3028 sysdig_secure_account_id = module. onboarding . sysdig_secure_account_id
3129}
3230
You can’t perform that action at this time.
0 commit comments