This repository contains the source code for the Tailscale Terraform provider. This Terraform provider lets you interact with the Tailscale API.
See the documentation in the Terraform registry for the most up-to-date information and latest release.
This provider is maintained by Tailscale. Thanks to everyone who contributed to the development of the Tailscale Terraform provider, and special thanks to davidsbond.
To install this provider, copy and paste this code into your Terraform configuration. Then, run terraform init
:
terraform {
required_providers {
tailscale = {
source = "tailscale/tailscale"
version = "0.13.6"
}
}
}
provider "tailscale" {
api_key = "my_api_key"
tailnet = "example.com"
}
In the provider
block, replace api_key
and tailnet
with your own tailnet and API key. Alternatively, use the
TAILSCALE_API_KEY
and TAILSCALE_TAILNET
environment variables.
The default api endpoint is https://api.tailscale.com
. If your coordination/control server api is at another endpoint, you can pass in base_url
in the provider block.
provider "tailscale" {
api_key = "my_api_key"
tailnet = "example.com"
base_url = "https://api.us.tailscale.com"
}
To update an existing terraform deployment currently using the original davidsbond/tailscale
provider, use:
terraform state replace-provider registry.terraform.io/davidsbond/tailscale registry.terraform.io/tailscale/tailscale
Please review the contributing guidelines and code of conduct before contributing to this codebase. Please create a new issue for bugs and feature requests and fill in as much detail as you can.