Skip to main content

Pulumi Tailscale Bastion

This repo provides a multi-language component that creates a Tailscale Subnet Router in your chosen cloud provider

Examples

Examples for all languages are in the examples directory.

Note, you need to create a VPC, and also add your worker nodes.

FAQs

AWS workload identity federation

AWS bastions can join Tailscale using their EC2 instance role, without storing an OAuth secret or auth key:

const bastion = new tailscalebastion.aws.Bastion("router", {
    vpcId: vpc.id,
    subnetIds: privateSubnetIds,
    region: "us-west-2",
    tailscaleTags: ["tag:router"],
    routes: ["10.0.0.0/16"],
    workloadIdentity: {
        clientId: config.require("tailscaleClientId"),
        audience: config.require("tailscaleAudience"),
    },
});
export const roleArn = bastion.roleArn;

Configure a Tailscale federated identity that trusts your AWS token issuer and matches the instance role's ARN as its subject. Grant it the auth_keys scope and the advertised tags. AWS outbound identity federation must be enabled/configured for your account. The client ID and audience are public identifiers; roleArn is exported to help configure the trust. Establish that trust before instances boot (or refresh the ASG after configuring it).

The component grants sts:GetWebIdentityToken for the configured audience and a maximum token lifetime of 300 seconds. Tailscale discovers the instance role and obtains its token at boot using --client-id and --audience (requires Tailscale 1.94+). Nodes remain ephemeral and preauthorized.

workloadIdentity and oauthClientSecret are mutually exclusive. Omitting both retains provider-created auth keys. AWS bootstrap uses pinned, embedded scripts from terraform-cloudinit-tailscale, installs the current stable Tailscale release by default, and supports both CPU architectures.

AWS Tailscale settings

AWS bastions accept the embedded upstream installation and node settings directly:

  • Installation: track (stable or unstable), maxRetries, retryDelay (seconds).
  • Connection: loginServer, timeout (for example 60s), json, reset, forceReauth.
  • Networking: acceptDNS, acceptRoutes, shieldsUp, snatSubnetRoutes, netfilterMode, statefulFiltering, exitNode, exitNodeAllowLANAccess.
  • Local management: operator (Unix username).

See the input defaults and upstream mappings. For example, set acceptRoutes: true to use other advertised subnet routes or snatSubnetRoutes: false to preserve source addresses on routed traffic.

Can you add support for X

Add an issue, but this is mainly designed to be useful for cloud providers I use, so I reserve the right to refuse.

Can you make X optional?

I have no plans to make any of the batteries included optional at this time

Installing

This package is available in many languages in the standard packaging formats.

Node.js (Java/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either npm:

$ npm install @lbrlabs/pulumi-tailscalebastion

or yarn:

$ yarn add @lbrlabs/pulumi-tailscalebastion

Python

To use from Python, install using pip:

$ pip install lbrlabs_pulumi_tailscalebastion

Go

To use from Go, use go get to grab the latest version of the library

$ go get github.com/lbrlabs/pulumi-tailscale-bastion/sdk/go/...

.NET

To use from Dotnet, use dotnet add package to install into your project. You must specify the version if it is a pre-release version.

$ dotnet add package Lbrlabs.PulumiPackage.TailscaleBastion

Reference

See the Pulumi registry for API docs:

https://www.pulumi.com/registry/packages/lbrlabs-tailscale-bastion/api-docs/

Metadata

Release files for lbrlabs-pulumi-tailscalebastion 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lbrlabs-pulumi-tailscalebastion 0.15.0
File Size Uploaded Provenance Actions
lbrlabs_pulumi_tailscalebastion-0.15.0.tar.gz 17.8 kB Without provenance Details for lbrlabs_pulumi_tailscalebastion-0.15.0.tar.gz

Release files / lbrlabs_pulumi_tailscalebastion-0.15.0.tar.gz

Download URL lbrlabs_pulumi_tailscalebastion-0.15.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3344b91b61c8e5051dc413de85d281f81367e5545ff113b17a12f06603c105fc
BLAKE2b-256 checksum
How to use checksums
32ff297ce37a35c91d34374c565098ec45d5af3bd89af1f1077cb05f7b40bd97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for lbrlabs-pulumi-tailscalebastion 0.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.15.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page