Skip to content

Commit

Permalink
Add documentation page for kubernetes_resource data source
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhouston committed Dec 13, 2021
1 parent 6a45fda commit 7e89a96
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions website/docs/d/resource.html.markdown
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.

0 comments on commit 7e89a96

Please sign in to comment.