Skip to content

Commit

Permalink
run terraform fmt on the examples directory (#280)
Browse files Browse the repository at this point in the history
I just ran `terraform fmt --recursive` on the examples directory and
then re-generated the docs.
  • Loading branch information
pgier authored Jul 20, 2023
1 parent 59cdd07 commit b82d16f
Show file tree
Hide file tree
Showing 29 changed files with 398 additions and 399 deletions.
32 changes: 16 additions & 16 deletions docs/data-sources/secure_connect_bundle_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,46 @@ data "astra_secure_connect_bundle_url" "scb" {
// Example 1: Hard-coded IDs
// Primary datacenter SCB
data "astra_secure_connect_bundle_url" "scb1" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
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"
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"
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"
}
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
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
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
database_id = astra_database.mydb.id
datacenter_id = astra_database.mydb.datacenters["${astra_database.mydb.cloud_provider}.${astra_database.mydb.regions[2]}"]
}
```
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/streaming_tenant_tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ data "astra_streaming_tenant_tokens" "tokens" {
// Example referencing astra_streaming_tenant
resource "astra_streaming_tenant" "tenant" {
tenant_name = "mytenant"
topic = "topic1"
region = "us-east4"
cloud_provider = "gcp"
user_email = "[email protected]"
tenant_name = "mytenant"
topic = "topic1"
region = "us-east4"
cloud_provider = "gcp"
user_email = "[email protected]"
}
data "astra_streaming_tenant_tokens" "tokens" {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Terraform 1.0 and later:
terraform {
required_providers {
astra = {
source = "datastax/astra"
source = "datastax/astra"
version = "2.1.15"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/access_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: |-
```terraform
resource "astra_access_list" "example" {
database_id = "a6bc9c26-e7ce-424f-84c7-0a00afb12588"
enabled = true
enabled = true
addresses {
address = "0.0.0.1/0"
enabled = true
Expand Down
78 changes: 39 additions & 39 deletions docs/resources/cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,57 +25,57 @@ resource "random_uuid" "identifier" {}
# Create a new tenant
resource "astra_streaming_tenant" "streaming_tenant" {
tenant_name = substr("webstore-clicks-${random_uuid.identifier.id}", 0, 32)
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = true
region = "us-central1"
tenant_name = substr("webstore-clicks-${random_uuid.identifier.id}", 0, 32)
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = false
region = "us-central1"
}
# Create a new database
resource "astra_database" "db_database" {
name = substr("webstore-clicks-${random_uuid.identifier.id}", 0, 50)
keyspace = "click_data" # 48 characters max
cloud_provider = "gcp" # this must match the cloud_provider of the tenant
regions = ["us-central1"] # this must match the region of the tenant
deletion_protection = false
name = substr("webstore-clicks-${random_uuid.identifier.id}", 0, 50)
keyspace = "click_data" # 48 characters max
cloud_provider = "gcp" # this must match the cloud_provider of the tenant
regions = ["us-central1"] # this must match the region of the tenant
deletion_protection = false
}
# Create a new table in that database
resource "astra_table" "db_table" {
keyspace = astra_database.db_database.keyspace
database_id = astra_database.db_database.id
region = astra_database.db_database.regions[0]
table = "all_product_clicks"
clustering_columns = "visitor_id:click_timestamp"
partition_keys = "visitor_id:click_url"
column_definitions = [
{
Name: "click_timestamp"
Static: false
TypeDefinition: "bigint"
},
{
Name: "visitor_id"
Static: false
TypeDefinition: "uuid"
},
{
Name: "click_url"
Static: false
TypeDefinition: "text"
}
]
keyspace = astra_database.db_database.keyspace
database_id = astra_database.db_database.id
region = astra_database.db_database.regions[0]
table = "all_product_clicks"
clustering_columns = "visitor_id:click_timestamp"
partition_keys = "visitor_id:click_url"
column_definitions = [
{
Name : "click_timestamp"
Static : false
TypeDefinition : "bigint"
},
{
Name : "visitor_id"
Static : false
TypeDefinition : "uuid"
},
{
Name : "click_url"
Static : false
TypeDefinition : "text"
}
]
}
# Create a new CDC connection between tenant topic and db table
resource "astra_cdc" "db_cdc" {
database_id = astra_database.db_database.id
database_name = astra_database.db_database.name
table = astra_table.db_table.table
keyspace = astra_database.db_database.keyspace
tenant_name = astra_streaming_tenant.streaming_tenant.tenant_name
topic_partitions = 3
database_id = astra_database.db_database.id
database_name = astra_database.db_database.name
table = astra_table.db_table.table
keyspace = astra_database.db_database.keyspace
tenant_name = astra_streaming_tenant.streaming_tenant.tenant_name
topic_partitions = 3
}
# --Formatted Outputs--
Expand Down
24 changes: 12 additions & 12 deletions docs/resources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ resource "random_pet" "pet_name" {}
# Create a new database
resource "astra_database" "example_db" {
# Required
name = substr( "my-database-${random_pet.pet_name.id}", 0, 50)
keyspace = "example_keyspace" # 48 characters max
cloud_provider = "gcp"
regions = ["us-central1"]
name = substr("my-database-${random_pet.pet_name.id}", 0, 50)
keyspace = "example_keyspace" # 48 characters max
cloud_provider = "gcp"
regions = ["us-central1"]
# Optional
deletion_protection = false
timeouts {
create = "30m"
update = "30m"
delete = "30m"
}
deletion_protection = false
timeouts {
create = "30m"
update = "30m"
delete = "30m"
}
}
# --Formatted Outputs--
Expand All @@ -49,12 +49,12 @@ resource "astra_database" "example_db" {
output "status" {
description = "Database status"
value = astra_database.example_db.status
value = astra_database.example_db.status
}
output "cqlsh_url" {
description = "CQL shell URL"
value = astra_database.example_db.cqlsh_url
value = astra_database.example_db.cqlsh_url
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/resources/keyspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ resource "random_pet" "pet_name" {}
# Create a new database
resource "astra_database" "example_db" {
# Required
name = substr( "my-database-${random_pet.pet_name.id}", 0, 50)
keyspace = "example_keyspace"
cloud_provider = "gcp"
regions = ["us-central1"]
deletion_protection = false
name = substr("my-database-${random_pet.pet_name.id}", 0, 50)
keyspace = "example_keyspace"
cloud_provider = "gcp"
regions = ["us-central1"]
deletion_protection = false
}
resource "astra_keyspace" "example_keyspace" {
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ resource "astra_database" "exampledb" {
# Example application keyspaces
resource "astra_keyspace" "appks1" {
name = "appks1"
name = "appks1"
database_id = astra_database.exampledb.id
}
resource "astra_keyspace" "appks2" {
name = "appks2"
name = "appks2"
database_id = astra_database.exampledb.id
}
resource "astra_keyspace" "appks3" {
name = "appks3"
name = "appks3"
database_id = astra_database.exampledb.id
}
Expand Down
42 changes: 21 additions & 21 deletions docs/resources/streaming_namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,39 @@ resource "random_pet" "server" {}
# Create a new tenant
resource "astra_streaming_tenant" "streaming_tenant" {
tenant_name = "my-tenant-${random_pet.server.id}"
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = false # let terraform destroy the tenant
region = "us-central1"
tenant_name = "my-tenant-${random_pet.server.id}"
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = false # let terraform destroy the tenant
region = "us-central1"
}
# Create a new namespace
resource "astra_streaming_namespace" "streaming_namespace" {
# Required
cluster = astra_streaming_tenant.streaming_tenant.cluster_name
tenant = astra_streaming_tenant.streaming_tenant.tenant_name
namespace = "my-namespace"
cluster = astra_streaming_tenant.streaming_tenant.cluster_name
tenant = astra_streaming_tenant.streaming_tenant.tenant_name
namespace = "my-namespace"
# Optional
policies = {
auto_topic_creation_override = {
policies = {
auto_topic_creation_override = {
allow_auto_topic_creation = true
default_num_partitions = 1
topic_type = "partitioned" # "partitioned" or "non_partitioned"
default_num_partitions = 1
topic_type = "partitioned" # "partitioned" or "non_partitioned"
}
backlog_quota_map = {
backlog_quota_map = {
"destination_storage" = {
"limit": 500170751,
"limit_size": 500170751,
"limit_time": 0,
"policy": "producer_exception" # "producer_exception" or "producer_request_hold" or "consumer_backlog_eviction"
"limit" : 500170751,
"limit_size" : 500170751,
"limit_time" : 0,
"policy" : "producer_exception" # "producer_exception" or "producer_request_hold" or "consumer_backlog_eviction"
}
}
is_allow_auto_update_schema = true
message_ttl_in_seconds = 0
retention_policies = {
retention_size_in_mb = 0
is_allow_auto_update_schema = true
message_ttl_in_seconds = 0
retention_policies = {
retention_size_in_mb = 0
retention_time_in_minutes = 0
}
schema_auto_update_compatibility_strategy = "Full"
Expand Down
18 changes: 9 additions & 9 deletions docs/resources/streaming_pulsar_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ resource "random_pet" "pet_name" {}
# Create a new tenant
resource "astra_streaming_tenant" "streaming_tenant" {
# Required
tenant_name = substr( "my-tenant-${random_pet.pet_name.id}", 0, 32)
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = false
region = "us-central1"
tenant_name = substr("my-tenant-${random_pet.pet_name.id}", 0, 32)
user_email = "[email protected]"
cloud_provider = "gcp"
deletion_protection = false
region = "us-central1"
}
# Create a new pulsar token for the tenant
resource "astra_streaming_pulsar_token" "streaming_token" {
# Required
cluster = astra_streaming_tenant.streaming_tenant.cluster_name
tenant = astra_streaming_tenant.streaming_tenant.tenant_name
cluster = astra_streaming_tenant.streaming_tenant.cluster_name
tenant = astra_streaming_tenant.streaming_tenant.tenant_name
# Optional
time_to_live = "30d" # Token will be valid for 30 days
time_to_live = "30d" # Token will be valid for 30 days
}
output "streaming_token" {
description = "The streaming token"
value = nonsensitive(astra_streaming_pulsar_token.streaming_token.token)
value = nonsensitive(astra_streaming_pulsar_token.streaming_token.token)
}
# --Formatted Outputs--
Expand Down
Loading

0 comments on commit b82d16f

Please sign in to comment.