1. Packages
  2. Astra DB
  3. API Docs
  4. Database
Astra DB v1.0.42 published on Tuesday, Jun 6, 2023 by pulumiverse

astra.Database

Explore with Pulumi AI

Import

 $ pulumi import astra:index/database:Database example 48bfc13b-c1a5-48db-b70f-b6ef9709872b
Copy

Example Usage

using System.Collections.Generic;
using Pulumi;
using Astra = Pulumiverse.Astra;

return await Deployment.RunAsync(() => 
{
    var example = new Astra.Database("example", new()
    {
        CloudProvider = "gcp",
        Keyspace = "keyspace",
        Regions = new[]
        {
            "us-east1",
        },
    });

});
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-astra/sdk/go/astra"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := astra.NewDatabase(ctx, "example", &astra.DatabaseArgs{
			CloudProvider: pulumi.String("gcp"),
			Keyspace:      pulumi.String("keyspace"),
			Regions: pulumi.StringArray{
				pulumi.String("us-east1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.astra.Database;
import com.pulumi.astra.DatabaseArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Database("example", DatabaseArgs.builder()        
            .cloudProvider("gcp")
            .keyspace("keyspace")
            .regions("us-east1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as astra from "@pulumi/astra";

const example = new astra.Database("example", {
    cloudProvider: "gcp",
    keyspace: "keyspace",
    regions: ["us-east1"],
});
Copy
import pulumi
import pulumiverse_astra as astra

example = astra.Database("example",
    cloud_provider="gcp",
    keyspace="keyspace",
    regions=["us-east1"])
Copy
resources:
  example:
    type: astra:Database
    properties:
      cloudProvider: gcp
      keyspace: keyspace
      regions:
        - us-east1
Copy

Create Database Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
             args: DatabaseArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def Database(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             cloud_provider: Optional[str] = None,
             keyspace: Optional[str] = None,
             regions: Optional[Sequence[str]] = None,
             deletion_protection: Optional[bool] = None,
             name: Optional[str] = None)
func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: astra:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DatabaseArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var databaseResource = new Astra.Database("databaseResource", new()
{
    CloudProvider = "string",
    Keyspace = "string",
    Regions = new[]
    {
        "string",
    },
    DeletionProtection = false,
    Name = "string",
});
Copy
example, err := astra.NewDatabase(ctx, "databaseResource", &astra.DatabaseArgs{
	CloudProvider: pulumi.String("string"),
	Keyspace:      pulumi.String("string"),
	Regions: pulumi.StringArray{
		pulumi.String("string"),
	},
	DeletionProtection: pulumi.Bool(false),
	Name:               pulumi.String("string"),
})
Copy
var databaseResource = new Database("databaseResource", DatabaseArgs.builder()
    .cloudProvider("string")
    .keyspace("string")
    .regions("string")
    .deletionProtection(false)
    .name("string")
    .build());
Copy
database_resource = astra.Database("databaseResource",
    cloud_provider="string",
    keyspace="string",
    regions=["string"],
    deletion_protection=False,
    name="string")
Copy
const databaseResource = new astra.Database("databaseResource", {
    cloudProvider: "string",
    keyspace: "string",
    regions: ["string"],
    deletionProtection: false,
    name: "string",
});
Copy
type: astra:Database
properties:
    cloudProvider: string
    deletionProtection: false
    keyspace: string
    name: string
    regions:
        - string
Copy

Database Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Database resource accepts the following input properties:

CloudProvider
This property is required.
Changes to this property will trigger replacement.
string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
Keyspace
This property is required.
Changes to this property will trigger replacement.
string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
Regions This property is required. List<string>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
DeletionProtection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
Name Changes to this property will trigger replacement. string
Astra database name.
CloudProvider
This property is required.
Changes to this property will trigger replacement.
string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
Keyspace
This property is required.
Changes to this property will trigger replacement.
string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
Regions This property is required. []string
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
DeletionProtection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
Name Changes to this property will trigger replacement. string
Astra database name.
cloudProvider
This property is required.
Changes to this property will trigger replacement.
String
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
keyspace
This property is required.
Changes to this property will trigger replacement.
String
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
regions This property is required. List<String>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
deletionProtection Boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
name Changes to this property will trigger replacement. String
Astra database name.
cloudProvider
This property is required.
Changes to this property will trigger replacement.
string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
keyspace
This property is required.
Changes to this property will trigger replacement.
string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
regions This property is required. string[]
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
deletionProtection boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
name Changes to this property will trigger replacement. string
Astra database name.
cloud_provider
This property is required.
Changes to this property will trigger replacement.
str
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
keyspace
This property is required.
Changes to this property will trigger replacement.
str
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
regions This property is required. Sequence[str]
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
deletion_protection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
name Changes to this property will trigger replacement. str
Astra database name.
cloudProvider
This property is required.
Changes to this property will trigger replacement.
String
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
keyspace
This property is required.
Changes to this property will trigger replacement.
String
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
regions This property is required. List<String>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
deletionProtection Boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
name Changes to this property will trigger replacement. String
Astra database name.

Outputs

All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:

AdditionalKeyspaces List<string>
Additional keyspaces
CqlshUrl string
The cqlsh_url
DataEndpointUrl string
The dataendpointurl
Datacenters Dictionary<string, string>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
GrafanaUrl string
The grafana_url
GraphqlUrl string
The graphql_url
Id string
The provider-assigned unique ID for this managed resource.
NodeCount int
The node_count
OrganizationId string
The org id.
OwnerId string
The owner id.
ReplicationFactor int
The replication_factor
Status string
The status
TotalStorage int
The total_storage
AdditionalKeyspaces []string
Additional keyspaces
CqlshUrl string
The cqlsh_url
DataEndpointUrl string
The dataendpointurl
Datacenters map[string]string
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
GrafanaUrl string
The grafana_url
GraphqlUrl string
The graphql_url
Id string
The provider-assigned unique ID for this managed resource.
NodeCount int
The node_count
OrganizationId string
The org id.
OwnerId string
The owner id.
ReplicationFactor int
The replication_factor
Status string
The status
TotalStorage int
The total_storage
additionalKeyspaces List<String>
Additional keyspaces
cqlshUrl String
The cqlsh_url
dataEndpointUrl String
The dataendpointurl
datacenters Map<String,String>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
grafanaUrl String
The grafana_url
graphqlUrl String
The graphql_url
id String
The provider-assigned unique ID for this managed resource.
nodeCount Integer
The node_count
organizationId String
The org id.
ownerId String
The owner id.
replicationFactor Integer
The replication_factor
status String
The status
totalStorage Integer
The total_storage
additionalKeyspaces string[]
Additional keyspaces
cqlshUrl string
The cqlsh_url
dataEndpointUrl string
The dataendpointurl
datacenters {[key: string]: string}
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
grafanaUrl string
The grafana_url
graphqlUrl string
The graphql_url
id string
The provider-assigned unique ID for this managed resource.
nodeCount number
The node_count
organizationId string
The org id.
ownerId string
The owner id.
replicationFactor number
The replication_factor
status string
The status
totalStorage number
The total_storage
additional_keyspaces Sequence[str]
Additional keyspaces
cqlsh_url str
The cqlsh_url
data_endpoint_url str
The dataendpointurl
datacenters Mapping[str, str]
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
grafana_url str
The grafana_url
graphql_url str
The graphql_url
id str
The provider-assigned unique ID for this managed resource.
node_count int
The node_count
organization_id str
The org id.
owner_id str
The owner id.
replication_factor int
The replication_factor
status str
The status
total_storage int
The total_storage
additionalKeyspaces List<String>
Additional keyspaces
cqlshUrl String
The cqlsh_url
dataEndpointUrl String
The dataendpointurl
datacenters Map<String>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
grafanaUrl String
The grafana_url
graphqlUrl String
The graphql_url
id String
The provider-assigned unique ID for this managed resource.
nodeCount Number
The node_count
organizationId String
The org id.
ownerId String
The owner id.
replicationFactor Number
The replication_factor
status String
The status
totalStorage Number
The total_storage

Look up Existing Database Resource

Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        additional_keyspaces: Optional[Sequence[str]] = None,
        cloud_provider: Optional[str] = None,
        cqlsh_url: Optional[str] = None,
        data_endpoint_url: Optional[str] = None,
        datacenters: Optional[Mapping[str, str]] = None,
        deletion_protection: Optional[bool] = None,
        grafana_url: Optional[str] = None,
        graphql_url: Optional[str] = None,
        keyspace: Optional[str] = None,
        name: Optional[str] = None,
        node_count: Optional[int] = None,
        organization_id: Optional[str] = None,
        owner_id: Optional[str] = None,
        regions: Optional[Sequence[str]] = None,
        replication_factor: Optional[int] = None,
        status: Optional[str] = None,
        total_storage: Optional[int] = None) -> Database
func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)
public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)
resources:  _:    type: astra:Database    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AdditionalKeyspaces List<string>
Additional keyspaces
CloudProvider Changes to this property will trigger replacement. string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
CqlshUrl string
The cqlsh_url
DataEndpointUrl string
The dataendpointurl
Datacenters Dictionary<string, string>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
DeletionProtection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
GrafanaUrl string
The grafana_url
GraphqlUrl string
The graphql_url
Keyspace Changes to this property will trigger replacement. string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
Name Changes to this property will trigger replacement. string
Astra database name.
NodeCount int
The node_count
OrganizationId string
The org id.
OwnerId string
The owner id.
Regions List<string>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
ReplicationFactor int
The replication_factor
Status string
The status
TotalStorage int
The total_storage
AdditionalKeyspaces []string
Additional keyspaces
CloudProvider Changes to this property will trigger replacement. string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
CqlshUrl string
The cqlsh_url
DataEndpointUrl string
The dataendpointurl
Datacenters map[string]string
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
DeletionProtection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
GrafanaUrl string
The grafana_url
GraphqlUrl string
The graphql_url
Keyspace Changes to this property will trigger replacement. string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
Name Changes to this property will trigger replacement. string
Astra database name.
NodeCount int
The node_count
OrganizationId string
The org id.
OwnerId string
The owner id.
Regions []string
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
ReplicationFactor int
The replication_factor
Status string
The status
TotalStorage int
The total_storage
additionalKeyspaces List<String>
Additional keyspaces
cloudProvider Changes to this property will trigger replacement. String
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
cqlshUrl String
The cqlsh_url
dataEndpointUrl String
The dataendpointurl
datacenters Map<String,String>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
deletionProtection Boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
grafanaUrl String
The grafana_url
graphqlUrl String
The graphql_url
keyspace Changes to this property will trigger replacement. String
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
name Changes to this property will trigger replacement. String
Astra database name.
nodeCount Integer
The node_count
organizationId String
The org id.
ownerId String
The owner id.
regions List<String>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
replicationFactor Integer
The replication_factor
status String
The status
totalStorage Integer
The total_storage
additionalKeyspaces string[]
Additional keyspaces
cloudProvider Changes to this property will trigger replacement. string
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
cqlshUrl string
The cqlsh_url
dataEndpointUrl string
The dataendpointurl
datacenters {[key: string]: string}
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
deletionProtection boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
grafanaUrl string
The grafana_url
graphqlUrl string
The graphql_url
keyspace Changes to this property will trigger replacement. string
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
name Changes to this property will trigger replacement. string
Astra database name.
nodeCount number
The node_count
organizationId string
The org id.
ownerId string
The owner id.
regions string[]
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
replicationFactor number
The replication_factor
status string
The status
totalStorage number
The total_storage
additional_keyspaces Sequence[str]
Additional keyspaces
cloud_provider Changes to this property will trigger replacement. str
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
cqlsh_url str
The cqlsh_url
data_endpoint_url str
The dataendpointurl
datacenters Mapping[str, str]
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
deletion_protection bool
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
grafana_url str
The grafana_url
graphql_url str
The graphql_url
keyspace Changes to this property will trigger replacement. str
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
name Changes to this property will trigger replacement. str
Astra database name.
node_count int
The node_count
organization_id str
The org id.
owner_id str
The owner id.
regions Sequence[str]
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
replication_factor int
The replication_factor
status str
The status
total_storage int
The total_storage
additionalKeyspaces List<String>
Additional keyspaces
cloudProvider Changes to this property will trigger replacement. String
The cloud provider to launch the database. (Currently supported: aws, azure, gcp)
cqlshUrl String
The cqlsh_url
dataEndpointUrl String
The dataendpointurl
datacenters Map<String>
Map of Datacenter IDs. The map key is "cloud_provider.region". Example: "GCP.us-east4".
deletionProtection Boolean
Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail. Defaults to true.
grafanaUrl String
The grafana_url
graphqlUrl String
The graphql_url
keyspace Changes to this property will trigger replacement. String
Initial keyspace name. For additional keyspaces, use the astra.Keyspace resource.
name Changes to this property will trigger replacement. String
Astra database name.
nodeCount Number
The node_count
organizationId String
The org id.
ownerId String
The owner id.
regions List<String>
Cloud regions to launch the database. (see https://docs.datastax.com/en/astra/docs/database-regions.html for supported regions)
replicationFactor Number
The replication_factor
status String
The status
totalStorage Number
The total_storage

Package Details

Repository
astra pulumiverse/pulumi-astra
License
Apache-2.0
Notes
This Pulumi package is based on the astra Terraform Provider.