Skip to content

Commit

Permalink
Merge pull request #23 from datastax/docs-love
Browse files Browse the repository at this point in the history
Docs Improvements
  • Loading branch information
dynajoe authored May 24, 2021
2 parents 787ff07 + 9a656b5 commit 5669d6a
Show file tree
Hide file tree
Showing 26 changed files with 117 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "astra_data_source_available_regions Data Source - terraform-provider-astra"
page_title: "astra_available_regions Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Retrieve a list of available cloud regions in Astra
---

# astra_data_source_available_regions (Data Source)
# astra_available_regions (Data Source)

Retrieve a list of available cloud regions in Astra

## Example Usage

```terraform
data "astra_data_source_available_regions" "regions" {
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 8 additions & 2 deletions docs/data-sources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
page_title: "astra_database Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Datasource for Astra database.
astra_database provides a datasource for Astra an Astra database. This can be used to select an existing database within your Astra Organization.
---

# astra_database (Data Source)

Datasource for Astra database.
`astra_database` provides a datasource for Astra an Astra database. This can be used to select an existing database within your Astra Organization.

## Example Usage

```terraform
data "astra_database" "db" {
database_id = "8d356587-73b3-430a-9c0e-d780332e2afb"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
14 changes: 12 additions & 2 deletions docs/data-sources/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
page_title: "astra_databases Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Retrieve a list of Astra databases.
astra_databases provides a datasource for a list of Astra databases. This can be used to select databases within your Astra Organization.
---

# astra_databases (Data Source)

Retrieve a list of Astra databases.
`astra_databases` provides a datasource for a list of Astra databases. This can be used to select databases within your Astra Organization.

## Example Usage

```terraform
data "astra_databases" "databaselist" {
status = "ACTIVE"
}
output "existing_dbs" {
value = [for db in data.astra_databases.databaselist.results : db.id]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 9 additions & 2 deletions docs/data-sources/keyspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
page_title: "astra_keyspace Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Keyspace for an Astra database.
astra_keyspace provides a datasource for a particular keyspace. See astra_keyspaces if you're looking to fetch all the keyspaces for a particular database.
---

# astra_keyspace (Data Source)

Keyspace for an Astra database.
`astra_keyspace` provides a datasource for a particular keyspace. See `astra_keyspaces` if you're looking to fetch all the keyspaces for a particular database.

## Example Usage

```terraform
data "astra_keyspace" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
name = "puppies"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 8 additions & 2 deletions docs/data-sources/keyspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
page_title: "astra_keyspaces Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Retrieve a list of keyspaces for an Astra database.
astra_keyspaces provides a datasource that lists the keyspaces in an Astra database.
---

# astra_keyspaces (Data Source)

Retrieve a list of keyspaces for an Astra database.
`astra_keyspaces` provides a datasource that lists the keyspaces in an Astra database.

## Example Usage

```terraform
data "astra_keyspaces" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 8 additions & 2 deletions docs/data-sources/secure_connect_bundle_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
page_title: "astra_secure_connect_bundle_url Data Source - terraform-provider-astra"
subcategory: ""
description: |-
Generate a temporary secure connect bundle URL for an Astra database.
astra_secure_connect_bundle_url provides a datasource that generates a temporary secure connect bundle URL. This URL lasts five minutes. Secure connect bundles are used to connect to Astra using cql cassandra drivers. See the docs https://docs.datastax.com/en/astra/docs/connecting-to-database.html for more information on how to connect.
---

# astra_secure_connect_bundle_url (Data Source)

Generate a temporary secure connect bundle URL for an Astra database.
`astra_secure_connect_bundle_url` provides a datasource that generates a temporary secure connect bundle URL. This URL lasts five minutes. Secure connect bundles are used to connect to Astra using cql cassandra drivers. See the [docs](https://docs.datastax.com/en/astra/docs/connecting-to-database.html) for more information on how to connect.

## Example Usage

```terraform
data "astra_secure_connect_bundle_url" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
24 changes: 14 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "astra Provider"
subcategory: ""
layout: ""
page_title: "Provider: DataStax Astra - Serverless Cassandra DBaaS"
description: |-
The Astra provider provides Terraform resources to interact with DataStax Astra databases.
---

# astra Provider
# DataStax Astra Provider

This provider allows DataStax Astra users to manage their full database lifecycle for Astra Serverless databases (built on Apache Cassandra(TM))
using Terraform.

To get started, log into [Astra](https://astra.datastax.com/register) and create an authorization token (in your organization settings). The provider will prompt you for the token
on apply if it does not detect it in your environment variable `ASTRA_API_TOKEN`.

Currently Astra Streaming (based on Apache Pulsar) is not supported.

## Example Usage

```terraform
```terraform
variable "token" {}
provider "astra" {
Expand All @@ -21,9 +26,8 @@ provider "astra" {
}
```

<!-- schema generated by tfplugindocs -->
## Schema
## Additional Info

### Optional
To report bugs or feature requests [file an issue on github](https://github.com/datastax/terraform-provider-astra/issues).

- **token** (String) Authentication token for Astra API.
For general help contact [support](https://houston.datastax.com/).
4 changes: 2 additions & 2 deletions docs/resources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "astra_database Resource - terraform-provider-astra"
subcategory: ""
description: |-
Astra Database.
astra_database provides an Astra Serverless Database resource. You can create and delete databases. Note: Classic Tier databases are not supported by the Terraform provider.
---

# astra_database (Resource)

Astra Database.
`astra_database` provides an Astra Serverless Database resource. You can create and delete databases. Note: Classic Tier databases are not supported by the Terraform provider.

## Example Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/keyspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "astra_keyspace Resource - terraform-provider-astra"
subcategory: ""
description: |-
Astra database Keyspace.
astra_keyspace provides a keyspace resource. Keyspaces are groupings of tables for Cassandra. astra_keyspace resources are associated with a database id. You can have multiple keyspaces per DB in addition to the default keyspace provided in the astra_database resource.
---

# astra_keyspace (Resource)

Astra database Keyspace.
`astra_keyspace` provides a keyspace resource. Keyspaces are groupings of tables for Cassandra. `astra_keyspace` resources are associated with a database id. You can have multiple keyspaces per DB in addition to the default keyspace provided in the `astra_database` resource.

## Example Usage

Expand Down
3 changes: 3 additions & 0 deletions examples/data-sources/astra_database/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "astra_database" "db" {
database_id = "8d356587-73b3-430a-9c0e-d780332e2afb"
}
4 changes: 4 additions & 0 deletions examples/data-sources/astra_keyspace/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "astra_keyspace" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
name = "puppies"
}
3 changes: 3 additions & 0 deletions examples/data-sources/astra_keyspaces/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "astra_keyspaces" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "astra_secure_connect_bundle_url" "dev" {
database_id = "f9f4b1e0-4c05-451e-9bba-d631295a7f73"
}
2 changes: 1 addition & 1 deletion internal/provider/data_source_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func dataSourceDatabase() *schema.Resource {
return &schema.Resource{
Description: "Datasource for Astra database.",
Description: "`astra_database` provides a datasource for Astra an Astra database. This can be used to select an existing database within your Astra Organization.",

ReadContext: dataSourceDatabaseRead,

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func dataSourceDatabases() *schema.Resource {
return &schema.Resource{
Description: "Retrieve a list of Astra databases.",
Description: "`astra_databases` provides a datasource for a list of Astra databases. This can be used to select databases within your Astra Organization.",

ReadContext: dataSourceDatabasesRead,

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func dataSourceKeyspace() *schema.Resource {
return &schema.Resource{
Description: "Keyspace for an Astra database.",
Description: "`astra_keyspace` provides a datasource for a particular keyspace. See `astra_keyspaces` if you're looking to fetch all the keyspaces for a particular database.",

ReadContext: dataSourceKeyspaceRead,

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_keyspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func dataSourceKeyspaces() *schema.Resource {
return &schema.Resource{
Description: "Retrieve a list of keyspaces for an Astra database.",
Description: "`astra_keyspaces` provides a datasource that lists the keyspaces in an Astra database.",

ReadContext: dataSourceKeyspacesRead,

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/data_source_secure_connect_bundle_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func dataSourceSecureConnectBundleURL() *schema.Resource {
return &schema.Resource{
Description: "Generate a temporary secure connect bundle URL for an Astra database.",
Description: "`astra_secure_connect_bundle_url` provides a datasource that generates a temporary secure connect bundle URL. This URL lasts five minutes. Secure connect bundles are used to connect to Astra using cql cassandra drivers. See the [docs](https://docs.datastax.com/en/astra/docs/connecting-to-database.html) for more information on how to connect.",

ReadContext: dataSourceSecureConnectBundleURLRead,

Expand Down
2 changes: 1 addition & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func New(version string) func() *schema.Provider {
"astra_keyspace": dataSourceKeyspace(),
"astra_keyspaces": dataSourceKeyspaces(),
"astra_secure_connect_bundle_url": dataSourceSecureConnectBundleURL(),
"astra_data_source_available_regions": dataSourceAvailableRegions(),
"astra_available_regions": dataSourceAvailableRegions(),
},
ResourcesMap: map[string]*schema.Resource{
"astra_database": resourceDatabase(),
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var databaseReadTimeout = time.Minute * 5

func resourceDatabase() *schema.Resource {
return &schema.Resource{
Description: "Astra Database.",

Description: "`astra_database` provides an Astra Serverless Database resource. You can create and delete databases. Note: Classic Tier databases are not supported by the Terraform provider.",
CreateContext: resourceDatabaseCreate,
ReadContext: resourceDatabaseRead,
DeleteContext: resourceDatabaseDelete,
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/resource_keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (

func resourceKeyspace() *schema.Resource {
return &schema.Resource{
Description: "Astra database Keyspace.",

Description: "`astra_keyspace` provides a keyspace resource. Keyspaces are groupings of tables for Cassandra. `astra_keyspace` resources are associated with a database id. You can have multiple keyspaces per DB in addition to the default keyspace provided in the `astra_database` resource.",
CreateContext: resourceKeyspaceCreate,
ReadContext: resourceKeyspaceRead,
DeleteContext: resourceKeyspaceDelete,
Expand Down
26 changes: 26 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: ""
page_title: "Provider: DataStax Astra - Serverless Cassandra DBaaS"
description: |-
The Astra provider provides Terraform resources to interact with DataStax Astra databases.
---

# DataStax Astra Provider

This provider allows DataStax Astra users to manage their full database lifecycle for Astra Serverless databases (built on Apache Cassandra(TM))
using Terraform.

To get started, log into [Astra](https://astra.datastax.com/register) and create an authorization token (in your organization settings). The provider will prompt you for the token
on apply if it does not detect it in your environment variable `ASTRA_API_TOKEN`.

Currently Astra Streaming (based on Apache Pulsar) is not supported.

## Example Usage

{{tffile "examples/provider/provider.tf"}}

## Additional Info

To report bugs or feature requests [file an issue on github](https://github.com/datastax/terraform-provider-astra/issues).

For general help contact [support](https://houston.datastax.com/).

0 comments on commit 5669d6a

Please sign in to comment.