Skip to content

Latest commit

 

History

History
469 lines (290 loc) · 17.7 KB

File metadata and controls

469 lines (290 loc) · 17.7 KB

API Reference

Constructs

TailscaleLambdaProxy

Initializers

import { TailscaleLambdaProxy } from 'tailscale-lambda-proxy'

new TailscaleLambdaProxy(scope: Construct, id: string, props: TailscaleLambdaProxyProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props TailscaleLambdaProxyProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
with Applies one or more mixins to this construct.

toString
public toString(): string

Returns a string representation of this construct.

with
public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

mixinsRequired
  • Type: ...constructs.IMixin[]

The mixins to apply.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { TailscaleLambdaProxy } from 'tailscale-lambda-proxy'

TailscaleLambdaProxy.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
extension tailscale-lambda-extension.TailscaleLambdaExtension No description.
lambda aws-cdk-lib.aws_lambda_nodejs.NodejsFunction No description.
lambdaFunctionUrl aws-cdk-lib.aws_lambda.FunctionUrl No description.
warmer aws-cdk-lib.aws_lambda_nodejs.NodejsFunction No description.
warmerRule aws-cdk-lib.aws_events.Rule No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


extensionRequired
public readonly extension: TailscaleLambdaExtension;
  • Type: tailscale-lambda-extension.TailscaleLambdaExtension

lambdaRequired
public readonly lambda: NodejsFunction;
  • Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction

lambdaFunctionUrlRequired
public readonly lambdaFunctionUrl: FunctionUrl;
  • Type: aws-cdk-lib.aws_lambda.FunctionUrl

warmerOptional
public readonly warmer: NodejsFunction;
  • Type: aws-cdk-lib.aws_lambda_nodejs.NodejsFunction

warmerRuleOptional
public readonly warmerRule: Rule;
  • Type: aws-cdk-lib.aws_events.Rule

Structs

TailscaleLambdaProxyProps

Initializer

import { TailscaleLambdaProxyProps } from 'tailscale-lambda-proxy'

const tailscaleLambdaProxyProps: TailscaleLambdaProxyProps = { ... }

Properties

Name Type Description
tsHostname string The "Machine" name as shown in the Tailscale admin console that identifies the Lambda function.
tsSecretApiKey aws-cdk-lib.aws_secretsmanager.ISecret The name of the AWS Secrets Manager secret that contains the pure text Tailscale API Key.
debug boolean No description.
options TailscaleLambdaProxyPropsOptions No description.
tsAdvertiseTags string Passed as --advertise-tags to tailscale up.
tsExitNode string Passed as --exit-node to tailscale up.
tsExitNodePingRetries number Number of ping attempts before giving up on the exit node reachability check.
tsExitNodePingTimeout number Per-attempt timeout in milliseconds for the exit node reachability ping.
tsExitNodeRequired boolean When true, the extension aborts (fail-closed) if the exit node is not reachable within the timeout.

tsHostnameRequired
public readonly tsHostname: string;
  • Type: string

The "Machine" name as shown in the Tailscale admin console that identifies the Lambda function.


tsSecretApiKeyRequired
public readonly tsSecretApiKey: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The name of the AWS Secrets Manager secret that contains the pure text Tailscale API Key.


debugOptional
public readonly debug: boolean;
  • Type: boolean

optionsOptional
public readonly options: TailscaleLambdaProxyPropsOptions;

tsAdvertiseTagsOptional
public readonly tsAdvertiseTags: string;
  • Type: string

Passed as --advertise-tags to tailscale up.

Required when using OAuth client keys (no expiry). Example: tag:lambda


tsExitNodeOptional
public readonly tsExitNode: string;
  • Type: string

Passed as --exit-node to tailscale up.

Routes all internet-bound Lambda traffic through the specified exit node (Tailscale IP or hostname). Example: 100.x.y.z


tsExitNodePingRetriesOptional
public readonly tsExitNodePingRetries: number;
  • Type: number
  • Default: 10

Number of ping attempts before giving up on the exit node reachability check.


tsExitNodePingTimeoutOptional
public readonly tsExitNodePingTimeout: number;
  • Type: number
  • Default: 2000

Per-attempt timeout in milliseconds for the exit node reachability ping.


tsExitNodeRequiredOptional
public readonly tsExitNodeRequired: boolean;
  • Type: boolean
  • Default: false

When true, the extension aborts (fail-closed) if the exit node is not reachable within the timeout.

When false / unset, it logs a warning and continues (fail-open).


TailscaleLambdaProxyPropsLambdaOption

Initializer

import { TailscaleLambdaProxyPropsLambdaOption } from 'tailscale-lambda-proxy'

const tailscaleLambdaProxyPropsLambdaOption: TailscaleLambdaProxyPropsLambdaOption = { ... }

Properties

Name Type Description
functionName string No description.
nodeTlsRejectUnauthorized boolean No description.

functionNameOptional
public readonly functionName: string;
  • Type: string

nodeTlsRejectUnauthorizedOptional
public readonly nodeTlsRejectUnauthorized: boolean;
  • Type: boolean

TailscaleLambdaProxyPropsOptions

Initializer

import { TailscaleLambdaProxyPropsOptions } from 'tailscale-lambda-proxy'

const tailscaleLambdaProxyPropsOptions: TailscaleLambdaProxyPropsOptions = { ... }

Properties

Name Type Description
extension aws-cdk-lib.aws_lambda.LayerVersionOptions No description.
lambda TailscaleLambdaProxyPropsLambdaOption No description.
warmer TailscaleLambdaProxyPropsWarmerOption If provided, a separate Lambda function will be created to periodically invoke the Tailscale proxy Lambda function to keep it warm.

extensionOptional
public readonly extension: LayerVersionOptions;
  • Type: aws-cdk-lib.aws_lambda.LayerVersionOptions

lambdaOptional
public readonly lambda: TailscaleLambdaProxyPropsLambdaOption;

warmerOptional
public readonly warmer: TailscaleLambdaProxyPropsWarmerOption;

If provided, a separate Lambda function will be created to periodically invoke the Tailscale proxy Lambda function to keep it warm.


TailscaleLambdaProxyPropsWarmerOption

Initializer

import { TailscaleLambdaProxyPropsWarmerOption } from 'tailscale-lambda-proxy'

const tailscaleLambdaProxyPropsWarmerOption: TailscaleLambdaProxyPropsWarmerOption = { ... }

Properties

Name Type Description
concurrentInvocations number No description.
functionName string No description.

concurrentInvocationsOptional
public readonly concurrentInvocations: number;
  • Type: number

functionNameOptional
public readonly functionName: string;
  • Type: string