Skip to content
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

Secret resource #16

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/resources/secret.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "identitycloud_secret Resource - terraform-provider-identitycloud"
subcategory: ""
description: |-
Resource to create and manage a secret.
---

# identitycloud_secret (Resource)

Resource to create and manage a secret.

## Example Usage

```terraform
resource "identitycloud_secret" "example" {
variable_id = "esv-mysecret1"
description = "My secret"
encoding = "generic"
value_base64 = base64encode("secretvalue")
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `encoding` (String) Type of base64 encoding used by the secret. Changing this value requires replacement of the resource. Supported values are `generic`, `pem`, `base64hmac`, `base64aes`.
- `secret_id` (String) ID of the secret. Must match the regex pattern `^esv-[a-z0-9_-]{1,124}$`.
- `use_in_placeholders` (Boolean) Whether the secret is used in placeholders. Changing this value requires replacement of the resource.
- `value_base64` (String) Base64 encoded value of the secret. Changing this value requires replacement of the resource.

### Optional

- `description` (String) Description of the secret.

### Read-Only

- `active_version` (String) Active version of the secret.
- `id` (String) ID of the secret.
- `last_change_date` (String) Date of the last change to the secret.
- `last_changed_by` (String) User who last changed the secret.
- `loaded` (Boolean) Whether the secret is loaded.
- `loaded_version` (String) Version of the secret that is loaded.

## Import

Import is supported using the following syntax:

```shell
terraform import identitycloud_secret.example secret_id
```
4 changes: 2 additions & 2 deletions docs/resources/variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "identitycloud_variable" "example" {
variable_id = "esv-myvariable1"
description = "My variable"
expression_type = "list"
value_base64 = "ZGF0YQ=="
value_base64 = base64encode("[]")
}
```

Expand All @@ -28,7 +28,7 @@ resource "identitycloud_variable" "example" {

- `expression_type` (String) The type of variable expression. Supported values are `string`, `list`, `array`, `object`, `bool`, `int`, `number`, `base64encodedinlined`, `keyvaluelist`.
- `value_base64` (String) Base64 encoded value of the variable.
- `variable_id` (String) ID of the variable
- `variable_id` (String) ID of the variable. Must match the regex `^esv-[a-z0-9_-]{1,124}$`.

### Optional

Expand Down
1 change: 1 addition & 0 deletions examples/resources/identitycloud_secret/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import identitycloud_secret.example secret_id
6 changes: 6 additions & 0 deletions examples/resources/identitycloud_secret/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "identitycloud_secret" "example" {
variable_id = "esv-mysecret1"
description = "My secret"
encoding = "generic"
value_base64 = base64encode("secretvalue")
}
2 changes: 1 addition & 1 deletion examples/resources/identitycloud_variable/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ resource "identitycloud_variable" "example" {
variable_id = "esv-myvariable1"
description = "My variable"
expression_type = "list"
value_base64 = "ZGF0YQ=="
value_base64 = base64encode("[]")
}
2 changes: 2 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/pingidentity/terraform-provider-identitycloud/internal/resource/cookiedomains"
"github.com/pingidentity/terraform-provider-identitycloud/internal/resource/csrs"
"github.com/pingidentity/terraform-provider-identitycloud/internal/resource/customdomains"
"github.com/pingidentity/terraform-provider-identitycloud/internal/resource/secrets"
"github.com/pingidentity/terraform-provider-identitycloud/internal/resource/variable"
internaltypes "github.com/pingidentity/terraform-provider-identitycloud/internal/types"
"github.com/pingidentity/terraform-provider-identitycloud/internal/utils"
Expand Down Expand Up @@ -179,6 +180,7 @@ func (p *identityCloudProvider) Resources(_ context.Context) []func() resource.R
cookiedomains.CookieDomainsResource,
csrs.CertificateSigningRequestResource,
customdomains.CustomDomainsResource,
secrets.SecretResource,
variable.VariableResource,
}
}
Loading
Loading