UNPKG

@mapped/pulumi-astra

Version:

A Pulumi package for creating and managing astra cloud resources.

115 lines 4.97 kB
"use strict"; // *** 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.Cdc = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * `astra.Cdc` enables cdc for an Astra Serverless table. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_astra from "@mapped/pulumi-astra"; * * const streamingTenant_1 = new astra.StreamingTenant("streamingTenant-1", { * tenantName: "terraformtest", * topic: "terraformtest", * region: "useast-4", * cloudProvider: "gcp", * userEmail: "seb@datastax.com", * }); * const cdc_1 = new astra.Cdc("cdc-1", { * databaseId: "5b70892f-e01a-4595-98e6-19ecc9985d50", * databaseName: "sai_test", * table: "test", * keyspace: "sai_test", * topicPartitions: 3, * tenantName: streamingTenant_1.tenantName, * }, { * dependsOn: [streamingTenant_1], * }); * ``` * * ## Import * * ```sh * $ pulumi import astra:index/cdc:Cdc example databaseId/keyspace/table/tenantName * ``` */ class Cdc extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["connectorStatus"] = state ? state.connectorStatus : undefined; resourceInputs["dataTopic"] = state ? state.dataTopic : undefined; resourceInputs["databaseId"] = state ? state.databaseId : undefined; resourceInputs["databaseName"] = state ? state.databaseName : undefined; resourceInputs["keyspace"] = state ? state.keyspace : undefined; resourceInputs["table"] = state ? state.table : undefined; resourceInputs["tenantName"] = state ? state.tenantName : undefined; resourceInputs["topicPartitions"] = state ? state.topicPartitions : undefined; } else { const args = argsOrState; if ((!args || args.databaseId === undefined) && !opts.urn) { throw new Error("Missing required property 'databaseId'"); } if ((!args || args.databaseName === undefined) && !opts.urn) { throw new Error("Missing required property 'databaseName'"); } if ((!args || args.keyspace === undefined) && !opts.urn) { throw new Error("Missing required property 'keyspace'"); } if ((!args || args.table === undefined) && !opts.urn) { throw new Error("Missing required property 'table'"); } if ((!args || args.tenantName === undefined) && !opts.urn) { throw new Error("Missing required property 'tenantName'"); } if ((!args || args.topicPartitions === undefined) && !opts.urn) { throw new Error("Missing required property 'topicPartitions'"); } resourceInputs["databaseId"] = args ? args.databaseId : undefined; resourceInputs["databaseName"] = args ? args.databaseName : undefined; resourceInputs["keyspace"] = args ? args.keyspace : undefined; resourceInputs["table"] = args ? args.table : undefined; resourceInputs["tenantName"] = args ? args.tenantName : undefined; resourceInputs["topicPartitions"] = args ? args.topicPartitions : undefined; resourceInputs["connectorStatus"] = undefined /*out*/; resourceInputs["dataTopic"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Cdc.__pulumiType, name, resourceInputs, opts); } /** * Get an existing Cdc 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 Cdc(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Cdc. 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'] === Cdc.__pulumiType; } } exports.Cdc = Cdc; /** @internal */ Cdc.__pulumiType = 'astra:index/cdc:Cdc'; //# sourceMappingURL=cdc.js.map