GithubHelp home page GithubHelp logo

tailscale.node-provider's Introduction

tscalectl CLI

Add AWS EC2 instances into your tailscale network (tailnet). Provides easy SSH access to your instances. Afterwards, delete EC2 instance and associated resources with a single command.

Installation

go install github.com/svennjegac/tailscale.node-provider/[email protected]

Prerequisites

  1. Generate Reusable & Ephemeral Tailscale Auth key. (https://login.tailscale.com/admin/settings/keys)
    img_2.png
  2. Generate AWS access key and secret. Give admin permissions to keys. It is possible to restrict access, but I did not take time yet to define proper IAM policy document. (https://aws.amazon.com/premiumsupport/knowledge-center/create-access-key/)
    img_3.png
  3. Add autoApprovers to your Tailscale ACL configuration. (Normally, when you advertise EC2 instance as exit node, you will need to manually approve it through UI. This ACL rule automates approving step)
    img_4.png
  4. You will be prompted to enter credentials when invoking commands which communicate with AWS / Tailscale. (We will get to that in the next section)

Usage

tscalectl up -i -e [flags]

Add AWS EC2 instance into your tailnet.

  1. Run tscalectl up -i -e (interactive & exit-node flags turned ON).
  2. Enter credentials which were created in the Prerequsites section. (AWS creds + Tailscale auth key)
  3. Interactive flag will prompt you to provide region, instanceType and instance AMI. Enter the number which indicates chosen region. (And do the same for instanceType and AMI).
    img_8.png
  4. Afterwards, CLI will proceed with VPN node provisioning.
    img_9.png
  5. Once done, CLI will inform you that your node is ready for use.
    img_10.png
  6. You will be able to see and use your tailscale nodes.
    img_11.png

tscalectl up -r=eu-north-1 -t=t3.small -a=ami-0440e5026412ff23f

Add AWS EC2 instance into your tailnet. Skip prompts for user input.

  1. Run tscalectl up -r=eu-north-1 -t=t3.small -a=ami-0440e5026412ff23f (Add -e flag if you want to make it exit node) If you want, you can omit one or more flags (r/t/a), and add -i flag. You will be prompted only for parameters you didn't specify, e.g. AMI.
  2. Without any prompts, CLI will proceed and it will add EC2 VPN node.

tscaleclt state list

  • List your AWS nodes.
    img_12.png

tscalectl state dump

  • Dump internal CLI state.
    img_13.png

tscalectl ssh [nodeID]

  • Print SSH command which can be used to connect to EC2 instance.
    img_14.png

tscalectl down [nodeID]

  • Terminate EC2 instance, delete its security group and key pair. Remove node from internal CLI state. Delete local SSH keys for instance.
    img_15.png

tailscale.node-provider's People

Contributors

svennjegac avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.