|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "astro_api_token Resource - astro" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + API Token resource |
| 7 | +--- |
| 8 | + |
| 9 | +# astro_api_token (Resource) |
| 10 | + |
| 11 | +API Token resource |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +resource "astro_api_token" "example_organization_token" { |
| 17 | + name = "organization api token" |
| 18 | + description = "organization api token description" |
| 19 | + type = "ORGANIZATION" |
| 20 | + roles = [{ |
| 21 | + "role" : "ORGANIZATION_OWNER", |
| 22 | + "entity_id" : "clx42kkcm01fo01o06agtmshg", |
| 23 | + "entity_type" : "ORGANIZATION" |
| 24 | + }] |
| 25 | + expiry_period_in_days = 30 |
| 26 | +} |
| 27 | +
|
| 28 | +resource "astro_api_token" "example_organization_token_with_multiple_roles" { |
| 29 | + name = "organization api token with multiple roles" |
| 30 | + description = "organization api token description" |
| 31 | + type = "ORGANIZATION" |
| 32 | + roles = [{ |
| 33 | + "role" : "ORGANIZATION_OWNER", |
| 34 | + "entity_id" : "clx42kkcm01fo01o06agtmshg", |
| 35 | + "entity_type" : "ORGANIZATION" |
| 36 | + }, |
| 37 | + { |
| 38 | + "role" : "WORKSPACE_OWNER", |
| 39 | + "entity_id" : "clx42sxw501gl01o0gjenthnh", |
| 40 | + "entity_type" : "WORKSPACE" |
| 41 | + }, |
| 42 | + { |
| 43 | + "role" : "DEPLOYMENT_ADMIN", |
| 44 | + "entity_id" : "clyn6kxud003x01mtxmccegnh", |
| 45 | + "entity_type" : "DEPLOYMENT" |
| 46 | + }] |
| 47 | +} |
| 48 | +
|
| 49 | +resource "astro_api_token" "example_workspace_token" { |
| 50 | + name = "workspace api token" |
| 51 | + description = "workspace api token description" |
| 52 | + type = "WORKSPACE" |
| 53 | + roles = [{ |
| 54 | + "role" : "WORKSPACE_OWNER", |
| 55 | + "entity_id" : "clx42sxw501gl01o0gjenthnh", |
| 56 | + "entity_type" : "WORKSPACE" |
| 57 | + }] |
| 58 | +} |
| 59 | +
|
| 60 | +resource "astro_api_token" "example_workspace_token_with_deployment_role" { |
| 61 | + name = "workspace api token" |
| 62 | + description = "workspace api token description" |
| 63 | + type = "WORKSPACE" |
| 64 | + roles = [{ |
| 65 | + "role" : "WORKSPACE_OWNER", |
| 66 | + "entity_id" : "clx42sxw501gl01o0gjenthnh", |
| 67 | + "entity_type" : "WORKSPACE" |
| 68 | + }, |
| 69 | + { |
| 70 | + "role" : "DEPLOYMENT_ADMIN", |
| 71 | + "entity_id" : "clyn6kxud003x01mtxmccegnh", |
| 72 | + "entity_type" : "DEPLOYMENT" |
| 73 | + }] |
| 74 | +} |
| 75 | +
|
| 76 | +resource "astro_api_token" "example_deployment_token" { |
| 77 | + name = "deployment api token" |
| 78 | + description = "deployment api token description" |
| 79 | + type = "DEPLOYMENT" |
| 80 | + roles = [{ |
| 81 | + "role" : "DEPLOYMENT_ADMIN", |
| 82 | + "entity_id" : "clyn6kxud003x01mtxmccegnh", |
| 83 | + "entity_type" : "DEPLOYMENT" |
| 84 | + }] |
| 85 | +} |
| 86 | +
|
| 87 | +resource "astro_api_token" "example_deployment_token_with_custom_role" { |
| 88 | + name = "deployment api token with custom role" |
| 89 | + description = "deployment api token description" |
| 90 | + type = "DEPLOYMENT" |
| 91 | + roles = [{ |
| 92 | + "role" : "CUSTOM_ROLE", |
| 93 | + "entity_id" : "clyn6kxud003x01mtxmccegnh", |
| 94 | + "entity_type" : "DEPLOYMENT" |
| 95 | + }] |
| 96 | +} |
| 97 | +``` |
| 98 | + |
| 99 | +<!-- schema generated by tfplugindocs --> |
| 100 | +## Schema |
| 101 | + |
| 102 | +### Required |
| 103 | + |
| 104 | +- `name` (String) API Token name |
| 105 | +- `roles` (Attributes Set) The roles assigned to the API Token (see [below for nested schema](#nestedatt--roles)) |
| 106 | +- `type` (String) API Token type - if changing this value, the API Token will be recreated with the new type |
| 107 | + |
| 108 | +### Optional |
| 109 | + |
| 110 | +- `description` (String) API Token description |
| 111 | +- `expiry_period_in_days` (Number) API Token expiry period in days |
| 112 | + |
| 113 | +### Read-Only |
| 114 | + |
| 115 | +- `created_at` (String) API Token creation timestamp |
| 116 | +- `created_by` (Attributes) API Token creator (see [below for nested schema](#nestedatt--created_by)) |
| 117 | +- `end_at` (String) time when the API token will expire in UTC |
| 118 | +- `id` (String) API Token identifier |
| 119 | +- `last_used_at` (String) API Token last used timestamp |
| 120 | +- `short_token` (String) API Token short token |
| 121 | +- `start_at` (String) time when the API token will become valid in UTC |
| 122 | +- `token` (String, Sensitive) API Token value. Warning: This value will be saved in plaintext in the terraform state file. |
| 123 | +- `updated_at` (String) API Token last updated timestamp |
| 124 | +- `updated_by` (Attributes) API Token updater (see [below for nested schema](#nestedatt--updated_by)) |
| 125 | + |
| 126 | +<a id="nestedatt--roles"></a> |
| 127 | +### Nested Schema for `roles` |
| 128 | + |
| 129 | +Required: |
| 130 | + |
| 131 | +- `entity_id` (String) The ID of the entity to assign the role to |
| 132 | +- `entity_type` (String) The type of entity to assign the role to |
| 133 | +- `role` (String) The role to assign to the entity |
| 134 | + |
| 135 | + |
| 136 | +<a id="nestedatt--created_by"></a> |
| 137 | +### Nested Schema for `created_by` |
| 138 | + |
| 139 | +Read-Only: |
| 140 | + |
| 141 | +- `api_token_name` (String) |
| 142 | +- `avatar_url` (String) |
| 143 | +- `full_name` (String) |
| 144 | +- `id` (String) |
| 145 | +- `subject_type` (String) |
| 146 | +- `username` (String) |
| 147 | + |
| 148 | + |
| 149 | +<a id="nestedatt--updated_by"></a> |
| 150 | +### Nested Schema for `updated_by` |
| 151 | + |
| 152 | +Read-Only: |
| 153 | + |
| 154 | +- `api_token_name` (String) |
| 155 | +- `avatar_url` (String) |
| 156 | +- `full_name` (String) |
| 157 | +- `id` (String) |
| 158 | +- `subject_type` (String) |
| 159 | +- `username` (String) |
0 commit comments