-
Notifications
You must be signed in to change notification settings - Fork 2.1k
docs: add tctl and Terraform methods for creating Access Lists #69407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,25 @@ | ||
| <Admonition type="warning" title="Editing the generated roles"> | ||
| Avoid directly modifying the roles the guided flow creates for this Access | ||
| List. Keep their names and their `teleport.internal/access-list-preset*` labels | ||
| unchanged — the Web UI relies on both to recognize them as the roles generated | ||
| for this Access List. | ||
| To change what the list grants, update it through the Web UI Access List editor: | ||
| <Admonition type="warning" title="Editing the supporting roles"> | ||
| However you created the list, keep the supporting roles' names and their | ||
| `teleport.internal/access-list-preset*` labels unchanged. Both the Web UI Access | ||
| List editor and `tctl acl update` rely on them to recognize which roles belong | ||
| to this Access List. | ||
|
|
||
| 1. From the sidebar menu, click **Identity Governance** > **Access Lists**. | ||
| 2. Click on the target Access List. | ||
| 3. Click the **Access Definition** tab. | ||
| 4. Click **Edit Access**. | ||
| To change what the list grants: | ||
|
|
||
| If you created the list with Terraform produced by the Web UI editor, you can | ||
| still use the web editor to update the Access List and copy the updated Terraform it | ||
| generates. | ||
| - **Web UI** — from the sidebar menu, click **Identity Governance** > | ||
| **Access Lists**, click the target Access List, open the **Access Definition** | ||
| tab, then click **Edit Access**. | ||
| - **`tctl`** — rerun | ||
| [`tctl acl update`](../../../reference/cli/tctl.mdx#tctl-acl-update) with the | ||
| resource flags you want. It updates the supporting roles for you. | ||
| - **Terraform** — rerun | ||
| [`tctl acl update`](../../../reference/cli/tctl.mdx#tctl-acl-update) with the | ||
| resource flags you want and `--output terraform` to regenerate the | ||
| configuration, then apply it. | ||
|
|
||
| Editing the roles directly (via Terraform, `tctl`, or the role editor) may | ||
| make the Access List editor in the Web UI unable to parse them (only a limited | ||
| subset of role fields is supported by the editor) — at which point you can no | ||
| longer use the Web UI editor to change the list's grants, and must update the | ||
| Both tools support only a limited subset of role fields. If the roles end up | ||
| outside that subset, neither can change the list's grants — the Web UI editor | ||
| can no longer parse them, and `tctl acl update` rejects them rather than | ||
| silently dropping the fields you added. From that point on you must manage the | ||
| roles directly for the rest of the Access List's life. | ||
| </Admonition> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| `tctl acl create` was introduced in `tctl` v18.10.3. On earlier versions of | ||
| `tctl`, use the Web UI. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the JIT and Standing guides: the Terraform tab points to a Web UI step that no longer exists in the docs. In both
But the Web UI tab in this same diff was rewritten to drop the old "Deploy the Access List" section entirely; it now just says "click Create Access List Now." There's no more mention of a Terraform-copy option at the Deployment step anywhere in the Web UI tab. So a reader on an old Either the Web UI Deployment step still has a "copy Terraform" option and that needs to stay documented in the webui tab, or it doesn't and this fallback sentence is stale and needs rewriting. I have |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Every list-valued flag takes a comma-separated string, for example | ||
| `--members bob,carol`. Members can also be added after the fact with | ||
| [`tctl acl users add`](../../../reference/cli/tctl.mdx#tctl-acl-users-add). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ### Generate the configuration | ||
|
|
||
| The `tctl acl create --output terraform` command will not create anything, but | ||
| instead prints a Terraform module describing the Access List the other flags | ||
| define, which you can write straight to a file. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| Note the `type = "static"` field. Access Lists managed with Terraform must be | ||
| static so that Terraform can own their membership, and static lists do not | ||
| support periodic auditing. To learn the differences, see | ||
| [Static versus default Access Lists](../../../configuration/resource-guides/access-list.mdx#static-versus-default-access-lists). | ||
|
|
||
| ### Apply the configuration | ||
|
|
||
| Log in to your cluster, assigning <Var name="teleport.example.com:443" /> to your | ||
| Teleport proxy address and <Var name="email@example.com" /> to your Teleport | ||
| username: | ||
|
|
||
| ```code | ||
| $ tsh login --proxy=<Var name="teleport.example.com:443" /> --user=<Var name="email@example.com" /> | ||
| ``` | ||
|
|
||
| Generate temporary credentials for the Terraform provider: | ||
|
|
||
| ```code | ||
| $ eval "$(tctl terraform env)" | ||
| ``` | ||
|
|
||
| Initialize Terraform, preview the changes, and apply them: | ||
|
|
||
| ```code | ||
| $ terraform init | ||
| $ terraform plan | ||
| $ terraform apply | ||
| ``` | ||
|
|
||
| The Access List is created once `terraform apply` completes. | ||
|
|
||
| <Admonition type="note"> | ||
| The steps above use `tctl terraform env` to issue short-lived credentials, | ||
| which is convenient for trying things out locally. For remote environments | ||
| such as CI/CD pipelines or cloud VMs, see the | ||
| [Terraform provider documentation](../../../configuration/terraform-provider/terraform-provider.mdx) | ||
| for guidance on setting up the provider. | ||
| </Admonition> | ||
|
|
||
| To write the configuration by hand instead of generating it, or for the full set | ||
| of fields on the `teleport_access_list` and `teleport_access_list_member` | ||
| resources, see | ||
| [Creating Access Lists with IaC](../../../configuration/resource-guides/access-list.mdx). |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.