@twingate/pulumi-twingate
Version:
A Pulumi package for creating and managing Twingate cloud resources.
117 lines • 5.09 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.TwingateSSHResource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* SSH Resources are Twingate resources accessed via a Gateway.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as std from "@pulumi/std";
* import * as twingate from "@twingate/pulumi-twingate";
*
* const prod = new twingate.TwingateRemoteNetwork("prod", {name: "Production Network"});
* const tls = new twingate.TwingateX509CertificateAuthority("tls", {
* name: "My TLS CA",
* certificate: std.file({
* input: "ca.pem",
* }).then(invoke => invoke.result),
* });
* const ssh = new twingate.TwingateSSHCertificateAuthority("ssh", {
* name: "My SSH CA",
* publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIr+Aj3O8csUrFRNWS7wViafil3rMlZ0glQ/OZ0CjCti",
* });
* const main = new twingate.TwingateGateway("main", {
* remoteNetworkId: prod.id,
* address: "10.0.0.1:8443",
* x509CaId: tls.id,
* sshCaId: ssh.id,
* });
* const sshServer = new twingate.TwingateSSHResource("ssh_server", {
* name: "SSH Server",
* gatewayId: main.id,
* alias: "test.int",
* remoteNetworkId: prod.id,
* address: "10.128.0.105",
* username: "ubuntu",
* });
* ```
*/
class TwingateSSHResource extends pulumi.CustomResource {
/**
* Get an existing TwingateSSHResource 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 TwingateSSHResource(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of TwingateSSHResource. 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'] === TwingateSSHResource.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessGroups"] = state?.accessGroups;
resourceInputs["accessPolicies"] = state?.accessPolicies;
resourceInputs["address"] = state?.address;
resourceInputs["alias"] = state?.alias;
resourceInputs["gatewayId"] = state?.gatewayId;
resourceInputs["isVisible"] = state?.isVisible;
resourceInputs["name"] = state?.name;
resourceInputs["protocols"] = state?.protocols;
resourceInputs["remoteNetworkId"] = state?.remoteNetworkId;
resourceInputs["securityPolicyId"] = state?.securityPolicyId;
resourceInputs["tags"] = state?.tags;
resourceInputs["username"] = state?.username;
}
else {
const args = argsOrState;
if (args?.address === undefined && !opts.urn) {
throw new Error("Missing required property 'address'");
}
if (args?.gatewayId === undefined && !opts.urn) {
throw new Error("Missing required property 'gatewayId'");
}
if (args?.remoteNetworkId === undefined && !opts.urn) {
throw new Error("Missing required property 'remoteNetworkId'");
}
resourceInputs["accessGroups"] = args?.accessGroups;
resourceInputs["accessPolicies"] = args?.accessPolicies;
resourceInputs["address"] = args?.address;
resourceInputs["alias"] = args?.alias;
resourceInputs["gatewayId"] = args?.gatewayId;
resourceInputs["isVisible"] = args?.isVisible;
resourceInputs["name"] = args?.name;
resourceInputs["protocols"] = args?.protocols;
resourceInputs["remoteNetworkId"] = args?.remoteNetworkId;
resourceInputs["securityPolicyId"] = args?.securityPolicyId;
resourceInputs["tags"] = args?.tags;
resourceInputs["username"] = args?.username;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TwingateSSHResource.__pulumiType, name, resourceInputs, opts);
}
}
exports.TwingateSSHResource = TwingateSSHResource;
/** @internal */
TwingateSSHResource.__pulumiType = 'twingate:index/twingateSSHResource:TwingateSSHResource';
//# sourceMappingURL=twingateSSHResource.js.map