@twingate/pulumi-twingate
Version:
A Pulumi package for creating and managing Twingate cloud resources.
250 lines (249 loc) • 9.54 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Kubernetes 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 main = new twingate.TwingateGateway("main", {
* remoteNetworkId: prod.id,
* address: "10.0.0.1:8443",
* x509CaId: tls.id,
* });
* // Kubernetes resource accessed via in-cluster DNS
* const prodCluster = new twingate.TwingateKubernetesResource("prod_cluster", {
* name: "Production K8s",
* gatewayId: main.id,
* remoteNetworkId: prod.id,
* });
* // Kubernetes resource accessed via external address
* const externalCluster = new twingate.TwingateKubernetesResource("external_cluster", {
* name: "External K8s",
* address: "k8s-api.example.com",
* gatewayId: main.id,
* remoteNetworkId: prod.id,
* });
* ```
*/
export declare class TwingateKubernetesResource extends pulumi.CustomResource {
/**
* Get an existing TwingateKubernetesResource 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: string, id: pulumi.Input<pulumi.ID>, state?: TwingateKubernetesResourceState, opts?: pulumi.CustomResourceOptions): TwingateKubernetesResource;
/**
* Returns true if the given object is an instance of TwingateKubernetesResource. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is TwingateKubernetesResource;
/**
* Restrict access to certain group
*/
readonly accessGroups: pulumi.Output<outputs.TwingateKubernetesResourceAccessGroup[] | undefined>;
/**
* Restrict access according to JIT access policy
*/
readonly accessPolicies: pulumi.Output<outputs.TwingateKubernetesResourceAccessPolicy[] | undefined>;
/**
* The address of the Kubernetes Resource (IP or FQDN).
*/
readonly address: pulumi.Output<string>;
/**
* Set a DNS alias address for the Resource. Must be a DNS-valid name string.
*/
readonly alias: pulumi.Output<string | undefined>;
/**
* Path to bearer token file.
*/
readonly bearerTokenFile: pulumi.Output<string>;
/**
* Path to CA certificate file.
*/
readonly caFile: pulumi.Output<string>;
/**
* The ID of the Gateway used to access this Kubernetes Resource.
*/
readonly gatewayId: pulumi.Output<string>;
/**
* Whether the Gateway is running inside the same Kubernetes cluster that is represented by the Kubernetes Resource. Default is `true`.
*/
readonly inCluster: pulumi.Output<boolean>;
/**
* Controls whether this Resource will be visible in the main Resource list in the Twingate Client. Default is `true`.
*/
readonly isVisible: pulumi.Output<boolean>;
/**
* The name of the Kubernetes Resource.
*/
readonly name: pulumi.Output<string>;
/**
* Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
*/
readonly protocols: pulumi.Output<outputs.TwingateKubernetesResourceProtocols>;
/**
* The ID of the Remote Network the Kubernetes Resource belongs to.
*/
readonly remoteNetworkId: pulumi.Output<string>;
/**
* The ID of a `twingate.getTwingateSecurityPolicy` to set as this Resource's Security Policy. Default is 'Null' which points to `Default Policy` on Admin console.
*/
readonly securityPolicyId: pulumi.Output<string>;
/**
* A map of key-value pair tags to set on this resource.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
}>;
/**
* Create a TwingateKubernetesResource resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: TwingateKubernetesResourceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering TwingateKubernetesResource resources.
*/
export interface TwingateKubernetesResourceState {
/**
* Restrict access to certain group
*/
accessGroups?: pulumi.Input<pulumi.Input<inputs.TwingateKubernetesResourceAccessGroup>[]>;
/**
* Restrict access according to JIT access policy
*/
accessPolicies?: pulumi.Input<pulumi.Input<inputs.TwingateKubernetesResourceAccessPolicy>[]>;
/**
* The address of the Kubernetes Resource (IP or FQDN).
*/
address?: pulumi.Input<string>;
/**
* Set a DNS alias address for the Resource. Must be a DNS-valid name string.
*/
alias?: pulumi.Input<string>;
/**
* Path to bearer token file.
*/
bearerTokenFile?: pulumi.Input<string>;
/**
* Path to CA certificate file.
*/
caFile?: pulumi.Input<string>;
/**
* The ID of the Gateway used to access this Kubernetes Resource.
*/
gatewayId?: pulumi.Input<string>;
/**
* Whether the Gateway is running inside the same Kubernetes cluster that is represented by the Kubernetes Resource. Default is `true`.
*/
inCluster?: pulumi.Input<boolean>;
/**
* Controls whether this Resource will be visible in the main Resource list in the Twingate Client. Default is `true`.
*/
isVisible?: pulumi.Input<boolean>;
/**
* The name of the Kubernetes Resource.
*/
name?: pulumi.Input<string>;
/**
* Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
*/
protocols?: pulumi.Input<inputs.TwingateKubernetesResourceProtocols>;
/**
* The ID of the Remote Network the Kubernetes Resource belongs to.
*/
remoteNetworkId?: pulumi.Input<string>;
/**
* The ID of a `twingate.getTwingateSecurityPolicy` to set as this Resource's Security Policy. Default is 'Null' which points to `Default Policy` on Admin console.
*/
securityPolicyId?: pulumi.Input<string>;
/**
* A map of key-value pair tags to set on this resource.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}
/**
* The set of arguments for constructing a TwingateKubernetesResource resource.
*/
export interface TwingateKubernetesResourceArgs {
/**
* Restrict access to certain group
*/
accessGroups?: pulumi.Input<pulumi.Input<inputs.TwingateKubernetesResourceAccessGroup>[]>;
/**
* Restrict access according to JIT access policy
*/
accessPolicies?: pulumi.Input<pulumi.Input<inputs.TwingateKubernetesResourceAccessPolicy>[]>;
/**
* The address of the Kubernetes Resource (IP or FQDN).
*/
address?: pulumi.Input<string>;
/**
* Set a DNS alias address for the Resource. Must be a DNS-valid name string.
*/
alias?: pulumi.Input<string>;
/**
* Path to bearer token file.
*/
bearerTokenFile?: pulumi.Input<string>;
/**
* Path to CA certificate file.
*/
caFile?: pulumi.Input<string>;
/**
* The ID of the Gateway used to access this Kubernetes Resource.
*/
gatewayId: pulumi.Input<string>;
/**
* Whether the Gateway is running inside the same Kubernetes cluster that is represented by the Kubernetes Resource. Default is `true`.
*/
inCluster?: pulumi.Input<boolean>;
/**
* Controls whether this Resource will be visible in the main Resource list in the Twingate Client. Default is `true`.
*/
isVisible?: pulumi.Input<boolean>;
/**
* The name of the Kubernetes Resource.
*/
name?: pulumi.Input<string>;
/**
* Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
*/
protocols?: pulumi.Input<inputs.TwingateKubernetesResourceProtocols>;
/**
* The ID of the Remote Network the Kubernetes Resource belongs to.
*/
remoteNetworkId: pulumi.Input<string>;
/**
* The ID of a `twingate.getTwingateSecurityPolicy` to set as this Resource's Security Policy. Default is 'Null' which points to `Default Policy` on Admin console.
*/
securityPolicyId?: pulumi.Input<string>;
/**
* A map of key-value pair tags to set on this resource.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}