|
| 1 | +provider "google" { |
| 2 | + project = "mytestproject" |
| 3 | + region = "us-west1" |
| 4 | +} |
| 5 | + |
| 6 | +module "organization-threat-detection" { |
| 7 | + source = "../../../..//modules/services/webhook-datasource" |
| 8 | + project_id = "mytestproject" |
| 9 | + push_endpoint = "test_sysdig_secure_cloudingestion_endpoint" |
| 10 | + is_organizational = true |
| 11 | + organization_domain = "mytestorg.com" |
| 12 | +} |
| 13 | + |
| 14 | +module "organization-posture" { |
| 15 | + source = "../../../..//modules/services/service-principal" |
| 16 | + project_id = "mytestproject" |
| 17 | + service_account_name = "sysdig-secure" |
| 18 | + is_organizational = true |
| 19 | + organization_domain = "mytestorg.com" |
| 20 | +} |
| 21 | + |
| 22 | +terraform { |
| 23 | + |
| 24 | + required_providers { |
| 25 | + sysdig = { |
| 26 | + source = "sysdiglabs/sysdig" |
| 27 | + version = "~> 1.18.2" |
| 28 | + } |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +provider "sysdig" { |
| 33 | + sysdig_secure_url = "test_sysdig_secure_endpoint" |
| 34 | + sysdig_secure_api_token = "test_sysdig_secure_api_token" |
| 35 | +} |
| 36 | + |
| 37 | +resource "sysdig_secure_cloud_auth_account" "gcp_project_mytestproject" { |
| 38 | + enabled = true |
| 39 | + provider_id = "mytestproject" |
| 40 | + provider_type = "PROVIDER_GCP" |
| 41 | + |
| 42 | + feature { |
| 43 | + |
| 44 | + secure_threat_detection { |
| 45 | + enabled = true |
| 46 | + components = ["COMPONENT_WEBHOOK_DATASOURCE/secure-runtime"] |
| 47 | + } |
| 48 | + } |
| 49 | + component { |
| 50 | + type = "COMPONENT_WEBHOOK_DATASOURCE" |
| 51 | + instance = "secure-runtime" |
| 52 | + } |
| 53 | + component { |
| 54 | + type = "COMPONENT_SERVICE_PRINCIPAL" |
| 55 | + instance = "secure-onboarding" |
| 56 | + service_principal_metadata = jsonencode({ |
| 57 | + gcp = { |
| 58 | + key = module.organization-posture.service_account_key |
| 59 | + } |
| 60 | + }) |
| 61 | + } |
| 62 | +} |
| 63 | + |
| 64 | +resource "sysdig_secure_organization" "gcp_organization_mytestproject" { |
| 65 | + management_account_id = sysdig_secure_cloud_auth_account.gcp_project_mytestproject.id |
| 66 | + depends_on = [module.organization-posture] |
| 67 | +} |
| 68 | + |
0 commit comments