|
| 1 | +terraform { |
| 2 | + required_providers { |
| 3 | + dbtcloud = { |
| 4 | + source = "dbt-labs/dbtcloud" |
| 5 | + version = ">= 0.3" |
| 6 | + } |
| 7 | + } |
| 8 | +} |
| 9 | + |
| 10 | +provider "dbtcloud" { |
| 11 | + account_id = 1234 |
| 12 | + token = "xxxx" |
| 13 | + host_url = "https://dbt.com/api" |
| 14 | +} |
| 15 | + |
| 16 | +# ── Case 1: SCIM global config ──────────────────────────────────────────────── |
| 17 | +# Start: enabled=true, manual_updates_allowed=false, scim_controlled_license_type=false |
| 18 | +# Then toggle to test updates: |
| 19 | +# Step 2 — manual_updates_allowed=true |
| 20 | +# Step 3 — scim_controlled_license_type=true |
| 21 | +# Step 4 — enabled=false (disables SCIM entirely) |
| 22 | +resource "dbtcloud_scim_config" "main" { |
| 23 | + enabled = true |
| 24 | + manual_updates_allowed = true |
| 25 | + scim_controlled_license_type = true |
| 26 | +} |
| 27 | + |
| 28 | +# ── Case 2: create a SCIM token ─────────────────────────────────────────────── |
| 29 | +resource "dbtcloud_scim_config_token" "test" { |
| 30 | + name = "tf-test-scim" |
| 31 | +} |
| 32 | + |
| 33 | +output "scim_token" { |
| 34 | + value = dbtcloud_scim_config_token.test.token_string |
| 35 | + sensitive = true |
| 36 | +} |
| 37 | + |
| 38 | +# ── Case 3: read back current config (no-op plan) ───────────────────────────── |
| 39 | +# After applying Case 1, comment it out and uncomment this to verify no drift. |
| 40 | +# resource "dbtcloud_scim_config" "main" { |
| 41 | +# enabled = true |
| 42 | +# manual_updates_allowed = false |
| 43 | +# scim_controlled_license_type = false |
| 44 | +# } |
| 45 | + |
| 46 | +# ── Case 4: enable manual updates ───────────────────────────────────────────── |
| 47 | +# Uncomment and re-apply to test updating manual_updates_allowed=true. |
| 48 | +# resource "dbtcloud_scim_config" "main" { |
| 49 | +# enabled = true |
| 50 | +# manual_updates_allowed = true |
| 51 | +# scim_controlled_license_type = false |
| 52 | +# } |
| 53 | + |
| 54 | +# ── Case 5: enable scim_controlled_license_type ─────────────────────────────── |
| 55 | +# Uncomment and re-apply to test enabling license type control via SCIM. |
| 56 | +# resource "dbtcloud_scim_config" "main" { |
| 57 | +# enabled = true |
| 58 | +# manual_updates_allowed = true |
| 59 | +# scim_controlled_license_type = true |
| 60 | +# } |
| 61 | + |
| 62 | +# ── Case 6: disable SCIM entirely ───────────────────────────────────────────── |
| 63 | +# Uncomment and re-apply to verify enabled=false is accepted and reflected. |
| 64 | +# resource "dbtcloud_scim_config" "main" { |
| 65 | +# enabled = false |
| 66 | +# manual_updates_allowed = false |
| 67 | +# scim_controlled_license_type = false |
| 68 | +# } |
0 commit comments