Files
teleport/docs/pages/configuration/terraform-provider/terraform-provider.mdx
T
Paul Gottschling b19268b07b Add a Configuring Teleport docs section (#66255)
* Add a Configuring Teleport docs section

Make the how-to guides for managing Teleport resources with
Infrastructure as Code tools more prominent by placing them in a
Configuring Teleport section next to other foundational docs sections,
e.g., Installation and Upgrading. Frame the task of managing Teleport
with IaC as part of the broader task of configuring Teleport.

To do so, move the introduction of the "Static and Dynamic Resources"
page to a landing page for the new Configuration section. Move the
remaining part of that page to the References section, since it's an
advanced guide and more of a reference than a set of how-to
instructions.

This change also structures the Infrastructure as Code landing page into
a Configure Teleport landing page by including links to guides for
static as well as dynamic configuration. This adds clarity to the docs
since users won't immediately know that Teleport exposes these two
configuration variants.

* Update internal links

* Fix issues with the Configuring Teleport section

- Update the static/dynamic field table to use the correct field name,
  `spec.mode`.
- Change "Managing Resources" to "Resource Guides" for clarity, since
  all sections in Configuring Teleport would be about managing
  resources.
- Reorder Configuration sidebar sections to move Resource Guides last
  and tctl before Terraform and Kubernetes.
2026-06-11 20:27:46 +00:00

93 lines
3.1 KiB
Plaintext

---
title: Using the Teleport Terraform Provider
sidebar_label: Terraform Provider
description: How to manage dynamic resources using the Teleport Terraform provider.
videoBanner: YgNHD4SS8dg
sidebar_position: 2
tags:
- infrastructure-as-code
- conceptual
- zero-trust
---
The Teleport Terraform provider allows Teleport administrators to use Terraform to configure Teleport via
dynamic resources.
## Get started
For an example of using the Teleport Terraform provider to deploy Teleport
Agents, configure Single Sign-On, and manage role-based access controls, see
[Getting Started](./terraform-getting-started.mdx).
## Authenticate the provider
The provider must obtain an identity to connect to Teleport. The method to
obtain it depends on where the Terraform code is executed. You must pick the
correct guide for your setup.
For quick local demos, you can [generate temporary credentials](local.mdx) for
the Terraform provider.
If you are using a third-party cloud platform to manage infrastructure as code,
you can use the platform to authenticate the Teleport Terraform provider. The
Teleport Terraform provider integrates with the following solutions:
- [Spacelift](spacelift.mdx)
- [Terraform Cloud](terraform-cloud.mdx)
- [env zero](env0.mdx)
It is also possible to set up the Teleport Terraform provider with a [CI
platform or cloud VM](ci-or-cloud.mdx) that has a built-in authentication
system, as well as a [dedicated server](dedicated-server.mdx) with long-running
workloads.
If none of the above options fit your use case, you may want to consider
[long-lived credentials](long-lived-credentials.mdx). We discourage this option
because it is the least secure.
## Manage resources
Once you have a functional Teleport Terraform provider, you will want to
configure your resources with it.
For instructions on managing specific Teleport dynamic resources with Terraform,
read [Managing Resources with Infrastructure as
Code](../resource-guides/resource-guides.mdx).
The list of supported resources and their fields is available [in the Terraform
reference](../../reference/infrastructure-as-code/terraform-provider/terraform-provider.mdx).
Finally, you can [import your existing resources in Terraform](import-existing-resources.mdx).
## Upgrade the provider
Make sure the Teleport Terraform provider remains up to date so your
configuration is compatible with your Teleport backend.
1. Determine the version your Teleport cluster expects for client tools.
Substitute <Var name="example.teleport.sh" /> with the domain name of your
Teleport cluster. (This command assumes that you have the [jq
CLI](https://jqlang.org/) installed on your system.)
```code
$ curl https://<Var name="example.teleport.sh" />/webapi/ping | \
jq -r '.auto_update.tools_version'
(=teleport.version=)
```
1. Ensure the `terraform.required_providers` block of your Teleport Terraform
provider configuration specifies the correct version:
```hcl
terraform {
required_providers {
teleport = {
source = "terraform.releases.teleport.dev/gravitational/teleport"
version = "(=teleport.version=)"
}
}
}
```