Movatterモバイル変換


[0]ホーム

URL:


terraform-provider-tailscale

commandmodule
v0.24.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License:MITImports:3Imported by:0

Details

Repository

github.com/tailscale/terraform-provider-tailscale

Links

README

terraform-provider-tailscale

Go ReferenceGo Report CardGithub Actions

This repository contains the source code for theTailscale Terraform provider.This Terraform provider lets you interact with theTailscale API.

See thedocumentation in the Terraform registryfor 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 todavidsbond.

Getting Started

To install this provider, copy and paste this code into your Terraform configuration. Then, runterraform init:

terraform {  required_providers {    tailscale = {      source = "tailscale/tailscale"      version = "~> 0.16" // Latest 0.16.x    }  }}provider "tailscale" {  api_key = "tskey-api-..."}

In theprovider block, set your API key in theapi_key field. Alternatively, use theTAILSCALE_API_KEY environment variable.

Using OAuth client

Instead of using a personal API key, you can configure the provider to use anOAuth client, e.g.:

provider "tailscale" {  oauth_client_id = "..."  oauth_client_secret = "tskey-client-..."}
API endpoint

The default api endpoint ishttps://api.tailscale.com. If your coordination/control server API is at another endpoint, you can pass inbase_url in the provider block.

provider "tailscale" {  api_key = "tskey-api-..."  base_url = "https://api.us.tailscale.com"}

Updating an existing installation

To update an existing terraform deployment currently using the originaldavidsbond/tailscale provider, use:

terraform state replace-provider registry.terraform.io/davidsbond/tailscale registry.terraform.io/tailscale/tailscale

Contributing

Please review thecontributing guidelines andcode of conduct beforecontributing to this codebase. Please create anew issuefor bugs and feature requests and fill in as much detail as you can.

Local Provider Development

TheTerraform plugin documentation on debuggingprovides helpful strategies for debugging while developing plugins.

Namely, adding adevelopment overridefor thetailscale/tailscale provider allows for using your local copy of the provider instead of a published version.

Yourterraformrc should look something like the following:

provider_installation {  # This disables the version and checksum verifications for this  # provider and forces Terraform to look for the tailscale/tailscale  # provider plugin in the given directory.  dev_overrides {    "tailscale/tailscale" = "/path/to/this/repo/on/disk"  }  # For all other providers, install them directly from their origin provider  # registries as normal. If you omit this, Terraform will _only_ use  # the dev_overrides block, and so no other providers will be available.  direct {}}

Remember to runmake build to build the provider and pick up your local changes.

Acceptance Tests

Tests in this repo that are prefixed withTestAcc are acceptance tests which run against a real instance of the tailscale control plane.These tests are skipped unless theTF_ACC environment variable is set.Runningmake testacc sets theTF_ACC variable and runs the tests.

TheTF_ACC environment variable is handled byTerraform core codeand is not directly referenced in provider code.

The following tailscale specific environment variables must also be set:

  • TAILSCALE_BASE_URL
    • URL of the control plane
  • TAILSCALE_API_KEY
    • Tests will be performed against the tailnet which the key belongs to
  • TAILSCALE_TEST_DEVICE_NAME
    • The FQDN of a device owned by the owner of the API key in use

If you run a local control server with theterraform-acceptance-testing test scenario, then you can use the make ruletestacc_localwhich will correctly populate the necessary environment variables for you.

./tool/go run -tags tailscale_saas ./cmd/devcontrol --generate-test-devices=terraform-acceptance-testing &make testacc_local

Releasing

Our releases follow sem-ver format and follow the recommended versioning practicesas documented by HashiCorp.

Pushing a tag of the formatvX.Y.Z will trigger therelease workflow which usesgoreleaser to build and sign artifacts and generate aGitHub release.

GitHub releases are pulled in and served by theHashiCorp Terrafrom andOpenTofu registries for usage of the provider via Terraform or OpenTofu.

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

View all Source files

Directories

PathSynopsis
Package tailscale describes the resources and data sources provided by the terraform provider.
Package tailscale describes the resources and data sources provided by the terraform provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp