Skip to content

Commit

Permalink
{docs,examples,tailscale}: fix minor documentation mistakes (#432)
Browse files Browse the repository at this point in the history
Fix minor documentation mistakes that made their way into v0.17.0.
Namely:
- Clarify that advertised routes cannot be managed through terraform and
  not "routes" in general.
- Add missing example for posture_integration resource.
- Add missing example and import for tailnet_settings resource.

Updates #cleanup

Signed-off-by: Mario Minardi <mario@tailscale.com>
  • Loading branch information
mpminardi authored Sep 16, 2024
1 parent a46f500 commit 6c9ad08
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/resources/device_subnet_routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
page_title: "tailscale_device_subnet_routes Resource - terraform-provider-tailscale"
subcategory: ""
description: |-
"The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.
Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device and cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.
The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.
Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device: advertised routes cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.
Note: all routes enabled for the device through the admin console or autoApprovers in the ACL must be explicitly added to the routes attribute of this resource to avoid configuration drift.
---

# tailscale_device_subnet_routes (Resource)

"The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.
The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.

Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device and cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.
Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device: advertised routes cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.

Note: all routes enabled for the device through the admin console or autoApprovers in the ACL must be explicitly added to the routes attribute of this resource to avoid configuration drift.

Expand Down
11 changes: 10 additions & 1 deletion docs/resources/posture_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-

The posture_integration resource allows you to manage integrations with device posture data providers. See https://tailscale.com/kb/1288/device-posture for more information.


## Example Usage

```terraform
resource "tailscale_posture_integration" "sample_posture_integration" {
posture_provider = "falcon"
cloud_id = "us-1"
client_id = "clientid1"
client_secret = "test-secret1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
22 changes: 21 additions & 1 deletion docs/resources/tailnet_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ description: |-

The tailnet_settings resource allows you to configure settings for your tailnet. See https://tailscale.com/api#tag/tailnetsettings for more information.


## Example Usage

```terraform
resource "tailscale_tailnet_settings" "sample_tailnet_settings" {
devices_approval_on = true
devices_auto_updates_on = true
devices_key_duration_days = 5
users_approval_on = true
users_role_allowed_to_join_external_tailnet = "member"
posture_identity_collection_on = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -29,3 +40,12 @@ The tailnet_settings resource allows you to configure settings for your tailnet.
### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# ID doesn't matter.
terraform import tailscale_tailnet_settings.sample_preferences tailnet_settings
```
6 changes: 6 additions & 0 deletions examples/resources/tailscale_posture_integration/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "tailscale_posture_integration" "sample_posture_integration" {
posture_provider = "falcon"
cloud_id = "us-1"
client_id = "clientid1"
client_secret = "test-secret1"
}
2 changes: 2 additions & 0 deletions examples/resources/tailscale_tailnet_settings/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ID doesn't matter.
terraform import tailscale_tailnet_settings.sample_preferences tailnet_settings
8 changes: 8 additions & 0 deletions examples/resources/tailscale_tailnet_settings/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "tailscale_tailnet_settings" "sample_tailnet_settings" {
devices_approval_on = true
devices_auto_updates_on = true
devices_key_duration_days = 5
users_approval_on = true
users_role_allowed_to_join_external_tailnet = "member"
posture_identity_collection_on = true
}
4 changes: 2 additions & 2 deletions tailscale/resource_device_subnet_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
tsclient "github.com/tailscale/tailscale-client-go/v2"
)

const resourceDeviceSubnetRoutesDescription = `"The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.
const resourceDeviceSubnetRoutesDescription = `The device_subnet_routes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information.
Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device and cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.
Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device: advertised routes cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them.
Note: all routes enabled for the device through the admin console or autoApprovers in the ACL must be explicitly added to the routes attribute of this resource to avoid configuration drift.
`
Expand Down

0 comments on commit 6c9ad08

Please sign in to comment.