-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
36 lines (31 loc) · 822 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Define the Astra provider for Terraform
terraform {
required_providers {
astra = {
source = "datastax/astra"
version = "0.0.5-pre"
}
}
}
// Provide your Astra token
provider "astra" {
}
// Create the database and initial keyspace
resource "astra_database" "dev" {
name = "starship_enterprise"
keyspace = "life_support_systems"
cloud_provider = "AWS"
region = "eu-central-1"
}
// Get the location of the secure connect bundle
data "astra_secure_connect_bundle_url" "dev" {
database_id = astra_database.dev.id
}
// Output the created database id
output "database_id" {
value = astra_database.dev.id
}
// Output the download location for the secure connect bundle
output "secure_connect_bundle_url" {
value = data.astra_secure_connect_bundle_url.dev.url
}