@mapped/pulumi-astra
Version:
A Pulumi package for creating and managing astra cloud resources.
106 lines • 5.04 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Database = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* 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"],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import astra:index/database:Database example 48bfc13b-c1a5-48db-b70f-b6ef9709872b
* ```
*/
class Database extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalKeyspaces"] = state ? state.additionalKeyspaces : undefined;
resourceInputs["cloudProvider"] = state ? state.cloudProvider : undefined;
resourceInputs["cqlshUrl"] = state ? state.cqlshUrl : undefined;
resourceInputs["dataEndpointUrl"] = state ? state.dataEndpointUrl : undefined;
resourceInputs["grafanaUrl"] = state ? state.grafanaUrl : undefined;
resourceInputs["graphqlUrl"] = state ? state.graphqlUrl : undefined;
resourceInputs["keyspace"] = state ? state.keyspace : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nodeCount"] = state ? state.nodeCount : undefined;
resourceInputs["organizationId"] = state ? state.organizationId : undefined;
resourceInputs["ownerId"] = state ? state.ownerId : undefined;
resourceInputs["regions"] = state ? state.regions : undefined;
resourceInputs["replicationFactor"] = state ? state.replicationFactor : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["totalStorage"] = state ? state.totalStorage : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cloudProvider === undefined) && !opts.urn) {
throw new Error("Missing required property 'cloudProvider'");
}
if ((!args || args.keyspace === undefined) && !opts.urn) {
throw new Error("Missing required property 'keyspace'");
}
if ((!args || args.regions === undefined) && !opts.urn) {
throw new Error("Missing required property 'regions'");
}
resourceInputs["cloudProvider"] = args ? args.cloudProvider : undefined;
resourceInputs["keyspace"] = args ? args.keyspace : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["regions"] = args ? args.regions : undefined;
resourceInputs["additionalKeyspaces"] = undefined /*out*/;
resourceInputs["cqlshUrl"] = undefined /*out*/;
resourceInputs["dataEndpointUrl"] = undefined /*out*/;
resourceInputs["grafanaUrl"] = undefined /*out*/;
resourceInputs["graphqlUrl"] = undefined /*out*/;
resourceInputs["nodeCount"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["replicationFactor"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["totalStorage"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Database.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing Database resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Database(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Database. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Database.__pulumiType;
}
}
exports.Database = Database;
/** @internal */
Database.__pulumiType = 'astra:index/database:Database';
//# sourceMappingURL=database.js.map