-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation page for kubernetes_resource data source
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
layout: "kubernetes" | ||
page_title: "Kubernetes: kubernetes_resource" | ||
description: |- | ||
This is a generic data source for Kubernetes API resources | ||
--- | ||
|
||
# kubernetes_resource | ||
|
||
This data source is a generic way to retrieve resources from the Kubernetes API. | ||
|
||
### Example: Get data from a ConfigMap | ||
|
||
```hcl | ||
data "kubernetes_resource" "example" { | ||
apiVersion = "v1" | ||
kind = "ConfigMap" | ||
metadata = { | ||
name = "example" | ||
namespace = "default" | ||
} | ||
} | ||
output "test" { | ||
value = data.kubernetes_resource.example.object.data.TEST | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `apiVersion` - (Required) The API version for the requested resource. | ||
* `kind` - (Required) The kind for the requested resource. | ||
* `metadata` - (Required) The metadata for the requested resource. | ||
* `object` - (Optional) The response returned from the API server. | ||
|
||
### `metadata` | ||
|
||
#### Arguments | ||
|
||
* `name` - (Required) The name of the requested resource. | ||
* `namespace` - (Optional) The namespace of the requested resource. | ||
|