|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "stackit_service_account_key Resource - stackit" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Service account key schema. |
| 7 | + ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. |
| 8 | + Example Usage |
| 9 | + Automatically rotate service account keys |
| 10 | + |
| 11 | + resource "stackit_service_account" "sa" { |
| 12 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 13 | + name = "sa01" |
| 14 | + } |
| 15 | + |
| 16 | + resource "time_rotating" "rotate" { |
| 17 | + rotation_days = 80 |
| 18 | + } |
| 19 | + |
| 20 | + resource "stackit_service_account_key" "sa_key" { |
| 21 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 22 | + service_account_email = stackit_service_account.sa.email |
| 23 | + ttl_days = 90 |
| 24 | + |
| 25 | + rotate_when_changed = { |
| 26 | + rotation = time_rotating.rotate.id |
| 27 | + } |
| 28 | + } |
| 29 | +--- |
| 30 | + |
| 31 | +# stackit_service_account_key (Resource) |
| 32 | + |
| 33 | +Service account key schema. |
| 34 | + |
| 35 | +~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. |
| 36 | +## Example Usage |
| 37 | + |
| 38 | + |
| 39 | +### Automatically rotate service account keys |
| 40 | +```terraform |
| 41 | +resource "stackit_service_account" "sa" { |
| 42 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 43 | + name = "sa01" |
| 44 | +} |
| 45 | +
|
| 46 | +resource "time_rotating" "rotate" { |
| 47 | + rotation_days = 80 |
| 48 | +} |
| 49 | +
|
| 50 | +resource "stackit_service_account_key" "sa_key" { |
| 51 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 52 | + service_account_email = stackit_service_account.sa.email |
| 53 | + ttl_days = 90 |
| 54 | +
|
| 55 | + rotate_when_changed = { |
| 56 | + rotation = time_rotating.rotate.id |
| 57 | + } |
| 58 | +} |
| 59 | +
|
| 60 | +``` |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +<!-- schema generated by tfplugindocs --> |
| 65 | +## Schema |
| 66 | + |
| 67 | +### Required |
| 68 | + |
| 69 | +- `project_id` (String) The STACKIT project ID associated with the service account key. |
| 70 | +- `service_account_email` (String) The email address associated with the service account, used for account identification and communication. |
| 71 | + |
| 72 | +### Optional |
| 73 | + |
| 74 | +- `public_key` (String) Specifies the public_key (RSA2048 key-pair). If not provided, a certificate from STACKIT will be used to generate a private_key. |
| 75 | +- `rotate_when_changed` (Map of String) A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource. |
| 76 | +- `ttl_days` (Number) Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted |
| 77 | + |
| 78 | +### Read-Only |
| 79 | + |
| 80 | +- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`service_account_email`,`key_id`". |
| 81 | +- `json` (String, Sensitive) The raw JSON representation of the service account key json, available for direct use. |
| 82 | +- `key_id` (String) The unique identifier for the key associated with the service account. |
0 commit comments