Skip to content

Latest commit

 

History

History
199 lines (124 loc) · 7.35 KB

File metadata and controls

199 lines (124 loc) · 7.35 KB

API Reference

Constructs

TailscaleLambdaExtension

A Lambda Layer that contains the Tailscale extension.

It starts the Tailscale daemon and connects to the Tailscale network exposing a SOCKS5 proxy on port 1050 (socks://localhost:1055) to be accessed by the main Lambda runtime process.

The Lambda function using this layer requires the following Environment Variables:

  • TS_SECRET_API_KEY - The name of the AWS Secrets Manager secret that contains the Tailscale API Key.
  • TS_HOSTNAME - The "Machine" name as shown in the Tailscale admin console.

Optional Environment Variables:

  • TS_ADVERTISE_TAGS - Comma-separated Tailscale ACL tags to advertise (e.g. tag:lambda).
  • TS_EXIT_NODE - Tailscale IP of the exit node to route traffic through.
  • TS_EXIT_NODE_REQUIRED - Set to true to fail if exit node is unreachable (default: false).
  • TS_EXIT_NODE_PING_TIMEOUT - Per-ping timeout when waiting for exit node (default: 2000ms).
  • TS_EXIT_NODE_PING_RETRIES - Number of ping attempts when waiting for exit node (default: 10).

Initializers

import { TailscaleLambdaExtension } from 'tailscale-lambda-extension'

new TailscaleLambdaExtension(scope: Construct, id: string, props?: TailscaleLambdaExtensionProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props TailscaleLambdaExtensionProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

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 { TailscaleLambdaExtension } from 'tailscale-lambda-extension'

TailscaleLambdaExtension.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.
layer aws-cdk-lib.aws_lambda.LayerVersion No description.

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

The tree node.


layerRequired
public readonly layer: LayerVersion;
  • Type: aws-cdk-lib.aws_lambda.LayerVersion

Structs

TailscaleLambdaExtensionProps

Initializer

import { TailscaleLambdaExtensionProps } from 'tailscale-lambda-extension'

const tailscaleLambdaExtensionProps: TailscaleLambdaExtensionProps = { ... }

Properties

Name Type Description
options aws-cdk-lib.aws_lambda.LayerVersionOptions No description.

optionsOptional
public readonly options: LayerVersionOptions;
  • Type: aws-cdk-lib.aws_lambda.LayerVersionOptions