Skip to content

Commit 28fe2d9

Browse files
document target kubernetes resources for custom policy
Signed-off-by: Vasundhara Shukla <vasundharas@vmware.com>
1 parent ee2cccf commit 28fe2d9

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

docs/index.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ provider "tanzu-mission-control" {
5454
<!-- schema generated by tfplugindocs -->
5555
## Schema
5656

57-
### Required
58-
59-
- `endpoint` (String)
60-
- `vmw_cloud_api_token` (String, Sensitive)
61-
6257
### Optional
6358

6459
- `ca_cert` (String, Sensitive)
@@ -67,5 +62,7 @@ provider "tanzu-mission-control" {
6762
- `client_auth_cert_file` (String)
6863
- `client_auth_key` (String, Sensitive)
6964
- `client_auth_key_file` (String)
65+
- `endpoint` (String)
7066
- `insecure_allow_unverified_ssl` (Boolean)
67+
- `vmw_cloud_api_token` (String, Sensitive)
7168
- `vmw_cloud_endpoint` (String)

docs/resources/custom_policy.md

+28
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ In addition to the direct policy defined for a given object, each object has inh
3535
The scope parameter is mandatory in the schema and the user needs to add one of the defined scopes to the script for the provider to function.
3636
Only one scope per resource is allowed.
3737

38+
## Target Kubernetes Resources
39+
40+
All the custom policy recipes contain a Kubernetes Resource spec that contains `api_groups` and `kind` as sub fields.
41+
These attributes are of the kind `[]string` which the policy API supports. In terraform, while declaring multiple
42+
`api_groups` and `kinds` under one block of `target_kubernetes_resources` is validated by the API but not reflected on the UI.
43+
For UI comparison with Terraform, one must add multiple blocks of `target_kubernetes_resources`, each containing a API Group and a Kind.
44+
45+
Example:
46+
47+
```
48+
target_kubernetes_resources {
49+
api_groups = [
50+
"apps",
51+
]
52+
kinds = [
53+
"Event",
54+
]
55+
}
56+
target_kubernetes_resources {
57+
api_groups = [
58+
"batch",
59+
]
60+
kinds = [
61+
"Pod",
62+
]
63+
}
64+
```
65+
3866
## Cluster scoped TMC-block-nodeport-service Custom Policy
3967

4068
### Example Usage

templates/resources/custom_policy.md.tmpl

+28
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ In addition to the direct policy defined for a given object, each object has inh
3535
The scope parameter is mandatory in the schema and the user needs to add one of the defined scopes to the script for the provider to function.
3636
Only one scope per resource is allowed.
3737

38+
## Target Kubernetes Resources
39+
40+
All the custom policy recipes contain a Kubernetes Resource spec that contains `api_groups` and `kind` as sub fields.
41+
These attributes are of the kind `[]string` which the policy API supports. In terraform, while declaring multiple
42+
`api_groups` and `kinds` under one block of `target_kubernetes_resources` is validated by the API but not reflected on the UI.
43+
For UI comparison with Terraform, one must add multiple blocks of `target_kubernetes_resources`, each containing a API Group and a Kind.
44+
45+
Example:
46+
47+
```
48+
target_kubernetes_resources {
49+
api_groups = [
50+
"apps",
51+
]
52+
kinds = [
53+
"Event",
54+
]
55+
}
56+
target_kubernetes_resources {
57+
api_groups = [
58+
"batch",
59+
]
60+
kinds = [
61+
"Pod",
62+
]
63+
}
64+
```
65+
3866
## Cluster scoped TMC-block-nodeport-service Custom Policy
3967

4068
### Example Usage

0 commit comments

Comments
 (0)