generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support secure connect bundle for mult-dc (#191)
- Loading branch information
1 parent
db9c1d1
commit 3811424
Showing
3 changed files
with
137 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 50 additions & 2 deletions
52
examples/data-sources/astra_secure_connect_bundle_url/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
data "astra_secure_connect_bundle_url" "dev" { | ||
// For single DC databases, or to just get the primary datacenter Secure Connect Bundle | ||
data "astra_secure_connect_bundle_url" "scb" { | ||
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73" | ||
} | ||
} | ||
|
||
// For mult-DC databases, specify the datacenter ID | ||
// Example 1: Hard-coded IDs | ||
// Primary datacenter SCB | ||
data "astra_secure_connect_bundle_url" "scb1" { | ||
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73" | ||
datacenter_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73-1" // for the primary dataceneter, the datacenter ID is not required | ||
} | ||
// Second datacenter SCB | ||
data "astra_secure_connect_bundle_url" "scb2" { | ||
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73" | ||
datacenter_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73-2" | ||
} | ||
// Third datacenter SCB | ||
data "astra_secure_connect_bundle_url" "scb3" { | ||
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73" | ||
datacenter_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73-3" | ||
} | ||
|
||
// Example 2: Referenced IDs | ||
// Database example for referencing | ||
resource astra_database "mydb" { | ||
name = "dbname" | ||
keyspace = "testks" | ||
cloud_provider = "gcp" | ||
regions = ["us-west4", "us-east4", "us-central1"] | ||
timeouts { | ||
create = "45m" | ||
delete = "45m" | ||
update = "45m" | ||
} | ||
} | ||
// Primary datacenter SCB (GCP.us-west4) | ||
data "astra_secure_connect_bundle_url" "scb1" { | ||
database_id = astra_database.mydb.id | ||
datacenter_id = astra_database.mydb.datacenters["${astra_database.mydb.cloud_provider}.${astra_database.mydb.regions[0]}"] // for the primary dataceneter, the datacenter ID is not required | ||
} | ||
// Second datacenter SCB (GCP.us-east4) | ||
data "astra_secure_connect_bundle_url" "scb2" { | ||
database_id = astra_database.mydb.id | ||
datacenter_id = astra_database.mydb.datacenters["${astra_database.mydb.cloud_provider}.${astra_database.mydb.regions[1]}"] | ||
} | ||
// Third datacenter SCB (GCP.us-central1) | ||
data "astra_secure_connect_bundle_url" "scb3" { | ||
database_id = astra_database.mydb.id | ||
datacenter_id = astra_database.mydb.datacenters["${astra_database.mydb.cloud_provider}.${astra_database.mydb.regions[2]}"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters