Skip to content

Commit 15baf34

Browse files
Adding documentation for the secret_v1_data resource
1 parent f55ea0d commit 15baf34

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

docs/resources/secret_v1_data.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
subcategory: "core/v1"
3+
page_title: "Kubernetes: kubernetes_secret_v1_data"
4+
description: |-
5+
This resource allows Terraform to manage the data for a Secret that already exists.
6+
---
7+
8+
# kubernetes_secret_v1_data
9+
10+
This resource allows Terraform to manage data within a pre-existing Secret. This resource uses [field management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and [server-side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to manage only the data that is defined in the Terraform configuration. Existing data not specified in the configuration will be ignored. If data specified in the config is already managed by another client, it will cause a conflict which can be overridden by setting `force` to true.
11+
12+
<!-- schema generated by tfplugindocs -->
13+
## Schema
14+
15+
### Required
16+
17+
- `data` (Map of String) The data we want to add to the Secret.
18+
- `metadata` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--metadata))
19+
20+
### Optional
21+
22+
- `field_manager` (String) Set the name of the field manager for the specified labels.
23+
- `force` (Boolean) Force overwriting data that is managed outside of Terraform.
24+
25+
### Read-Only
26+
27+
- `id` (String) The ID of this resource.
28+
29+
<a id="nestedblock--metadata"></a>
30+
### Nested Schema for `metadata`
31+
32+
Required:
33+
34+
- `name` (String) The name of the Secret.
35+
36+
Optional:
37+
38+
- `namespace` (String) The namespace of the Secret.
39+
40+
## Example Usage
41+
42+
```terraform
43+
resource "kubernetes_secret_v1_data" "example" {
44+
metadata {
45+
name = "my-secret"
46+
}
47+
data = {
48+
"username" = "admin"
49+
"password" = "s3cr3t"
50+
}
51+
}
52+
```
53+
54+
## Import
55+
56+
This resource does not support the `import` command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it.
57+
58+

0 commit comments

Comments
 (0)