Secrets manager - Add examples, update docs (#95)

* Add examples, update docs

* Fix typo

---------

Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
Henrique Santos 2023-10-19 16:03:42 +01:00 committed by GitHub
parent 7a7f28a306
commit 59ee1b529e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 113 additions and 2 deletions

View file

@ -10,7 +10,14 @@ description: |-
Secrets Manager instance data source schema. Must have a `region` specified in the provider configuration.
## Example Usage
```terraform
data "stackit_secretsmanager_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
<!-- schema generated by tfplugindocs -->
## Schema
@ -22,6 +29,6 @@ Secrets Manager instance data source schema. Must have a `region` specified in t
### Read-Only
- `acls` (List of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation
- `acls` (Set of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`".
- `name` (String) Instance name.

View file

@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_secretsmanager_user Data Source - stackit"
subcategory: ""
description: |-
Secrets Manager user data source schema. Must have a region specified in the provider configuration.
---
# stackit_secretsmanager_user (Data Source)
Secrets Manager user data source schema. Must have a `region` specified in the provider configuration.
## Example Usage
```terraform
data "stackit_secretsmanager_user" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `instance_id` (String) ID of the Secrets Manager instance.
- `project_id` (String) STACKIT Project ID to which the instance is associated.
- `user_id` (String) The user's ID.
### Read-Only
- `description` (String) A user chosen description to differentiate between multiple users. Can't be changed after creation.
- `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`instance_id`,`user_id`".
- `username` (String) An auto-generated user name.
- `write_enabled` (Boolean) If true, the user has writeaccess to the secrets engine.

View file

@ -10,7 +10,15 @@ description: |-
Secrets Manager instance resource schema. Must have a `region` specified in the provider configuration.
## Example Usage
```terraform
resource "stackit_secretsmanager_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
}
```
<!-- schema generated by tfplugindocs -->
## Schema
@ -22,7 +30,7 @@ Secrets Manager instance resource schema. Must have a `region` specified in the
### Optional
- `acls` (List of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation
- `acls` (Set of String) The access control list for this instance. Each entry is an IP or IP range that is permitted to access, in CIDR notation
### Read-Only

View file

@ -0,0 +1,39 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_secretsmanager_user Resource - stackit"
subcategory: ""
description: |-
Secrets Manager user resource schema. Must have a region specified in the provider configuration.
---
# stackit_secretsmanager_user (Resource)
Secrets Manager user resource schema. Must have a `region` specified in the provider configuration.
## Example Usage
```terraform
resource "stackit_postgresflex_user" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
description = "Example user"
write_enabled = false
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `description` (String) A user chosen description to differentiate between multiple users. Can't be changed after creation.
- `instance_id` (String) ID of the Secrets Manager instance.
- `project_id` (String) STACKIT Project ID to which the instance is associated.
- `write_enabled` (Boolean) If true, the user has writeaccess to the secrets engine.
### Read-Only
- `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`instance_id`,`user_id`".
- `password` (String, Sensitive) An auto-generated password.
- `user_id` (String) The user's ID.
- `username` (String) An auto-generated user name.

View file

@ -0,0 +1,4 @@
data "stackit_secretsmanager_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

View file

@ -0,0 +1,5 @@
data "stackit_secretsmanager_user" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

View file

@ -0,0 +1,5 @@
resource "stackit_secretsmanager_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
}

View file

@ -0,0 +1,6 @@
resource "stackit_postgresflex_user" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
description = "Example user"
write_enabled = false
}