-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The cockroach_service_account resource allows the creation of service accounts via terraform.
- Loading branch information
Showing
12 changed files
with
542 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cockroach_service_account Resource - terraform-provider-cockroach" | ||
subcategory: "" | ||
description: |- | ||
CockroachDB Cloud service account. A service account represents a non-person user. By default a service account has no access but it can be accompanied by either a cockroachuserrole_grants user_role_grants resource or any number of cockroachuserrole_grant user_role_grant resources to grant it roles. | ||
--- | ||
|
||
# cockroach_service_account (Resource) | ||
|
||
CockroachDB Cloud service account. A service account represents a non-person user. By default a service account has no access but it can be accompanied by either a [cockroach_user_role_grants](user_role_grants) resource or any number of [cockroach_user_role_grant](user_role_grant) resources to grant it roles. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "cockroach_service_account" "prod_sa" { | ||
name = "Prod cluster SA" | ||
description = "A service account used for managing access to the prod cluster" | ||
} | ||
resource "cockroach_user_role_grants" "prod_sa" { | ||
user_id = cockroach_service_account.prod_sa.id | ||
roles = [ | ||
{ | ||
role_name = "CLUSTER_ADMIN", | ||
resource_type = "CLUSTER", | ||
resource_id = cockroach_cluster.prod.id | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) Name of the service account. | ||
|
||
### Optional | ||
|
||
- `description` (String) Description of the service account. | ||
|
||
### Read-Only | ||
|
||
- `created_at` (String) Creation time of the service account. | ||
- `creator_name` (String) Name of the creator of the service account. | ||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# format <resource> <service account id> | ||
terraform import cockroach_service_account.api_service_account 1f69fdd2-600a-4cfc-a9ba-16995df0d77d | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# format <resource> <service account id> | ||
terraform import cockroach_service_account.api_service_account 1f69fdd2-600a-4cfc-a9ba-16995df0d77d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resource "cockroach_service_account" "prod_sa" { | ||
name = "Prod cluster SA" | ||
description = "A service account used for managing access to the prod cluster" | ||
} | ||
|
||
resource "cockroach_user_role_grants" "prod_sa" { | ||
user_id = cockroach_service_account.prod_sa.id | ||
roles = [ | ||
{ | ||
role_name = "CLUSTER_ADMIN", | ||
resource_type = "CLUSTER", | ||
resource_id = cockroach_cluster.prod.id | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.