@mapped/pulumi-astra
Version:
A Pulumi package for creating and managing astra cloud resources.
86 lines • 4.13 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.PrivateLink = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* `astra.PrivateLink` provides a private link resource. Private Link is a private network endpoint that can be created to connect from your vpc to Astra without using a publicly routable IP address. `astra.PrivateLink` resources are associated with a database id. Once the privateLink resource is created in Astra it must be linked to an endpoint within your vpc, use `astra.PrivateLinkEndpoint` to do this.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as astra from "@pulumi/astra";
*
* const example = new astra.PrivateLink("example", {
* allowedPrincipals: ["arn:aws:iam::111708290731:user/sebastian.estevez"],
* databaseId: "a6bc9c26-e7ce-424f-84c7-0a00afb12588",
* datacenterId: "a6bc9c26-e7ce-424f-84c7-0a00afb12588",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import astra:index/privateLink:PrivateLink example a6bc9c26-e7ce-424f-84c7-0a00afb12588/datacenter/a6bc9c26-e7ce-424f-84c7-0a00afb12588/serviceNames/svc-name-here
* ```
*/
class PrivateLink extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedPrincipals"] = state ? state.allowedPrincipals : undefined;
resourceInputs["databaseId"] = state ? state.databaseId : undefined;
resourceInputs["datacenterId"] = state ? state.datacenterId : undefined;
resourceInputs["serviceName"] = state ? state.serviceName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.allowedPrincipals === undefined) && !opts.urn) {
throw new Error("Missing required property 'allowedPrincipals'");
}
if ((!args || args.databaseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseId'");
}
if ((!args || args.datacenterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'datacenterId'");
}
resourceInputs["allowedPrincipals"] = args ? args.allowedPrincipals : undefined;
resourceInputs["databaseId"] = args ? args.databaseId : undefined;
resourceInputs["datacenterId"] = args ? args.datacenterId : undefined;
resourceInputs["serviceName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PrivateLink.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing PrivateLink 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 PrivateLink(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PrivateLink. 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'] === PrivateLink.__pulumiType;
}
}
exports.PrivateLink = PrivateLink;
/** @internal */
PrivateLink.__pulumiType = 'astra:index/privateLink:PrivateLink';
//# sourceMappingURL=privateLink.js.map