Skip to content

Commit 6d69739

Browse files
authored
Merge pull request #24 from pluralsh/service-contexts
feat: Add service contexts
2 parents d9024e2 + ea23eb2 commit 6d69739

File tree

9 files changed

+291
-1572
lines changed

9 files changed

+291
-1572
lines changed

docs/resources/cluster.md

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ A representation of a cluster you can deploy to.
1717

1818
### Required
1919

20-
- `cloud` (String) The cloud provider used to create this cluster.
21-
- `cloud_settings` (Attributes) Cloud-specific settings for this cluster. (see [below for nested schema](#nestedatt--cloud_settings))
2220
- `name` (String) Human-readable name of this cluster, that also translates to cloud resource name.
2321

2422
### Optional
2523

2624
- `bindings` (Attributes) Read and write policies of this cluster. (see [below for nested schema](#nestedatt--bindings))
25+
- `cloud` (String) The cloud provider used to create this cluster.
26+
- `cloud_settings` (Attributes) Cloud-specific settings for this cluster. (see [below for nested schema](#nestedatt--cloud_settings))
2727
- `handle` (String) A short, unique human-readable name used to identify this cluster. Does not necessarily map to the cloud resource name.
28+
- `kubeconfig` (Attributes) (see [below for nested schema](#nestedatt--kubeconfig))
2829
- `node_pools` (Attributes Map) **Experimental, not ready for production use.** Map of node pool specs managed by this cluster, where the key is name of the node pool and value contains the spec. Leave empty for bring your own cluster. (see [below for nested schema](#nestedatt--node_pools))
2930
- `protect` (Boolean) If set to `true` then this cluster cannot be deleted.
3031
- `provider_id` (String) Provider used to create this cluster. Leave empty for bring your own cluster.
@@ -37,6 +38,35 @@ A representation of a cluster you can deploy to.
3738
- `id` (String) Internal identifier of this cluster.
3839
- `inserted_at` (String) Creation date of this cluster.
3940

41+
<a id="nestedatt--bindings"></a>
42+
### Nested Schema for `bindings`
43+
44+
Optional:
45+
46+
- `read` (Attributes Set) Read policies of this cluster. (see [below for nested schema](#nestedatt--bindings--read))
47+
- `write` (Attributes Set) Write policies of this cluster. (see [below for nested schema](#nestedatt--bindings--write))
48+
49+
<a id="nestedatt--bindings--read"></a>
50+
### Nested Schema for `bindings.read`
51+
52+
Optional:
53+
54+
- `group_id` (String)
55+
- `id` (String)
56+
- `user_id` (String)
57+
58+
59+
<a id="nestedatt--bindings--write"></a>
60+
### Nested Schema for `bindings.write`
61+
62+
Optional:
63+
64+
- `group_id` (String)
65+
- `id` (String)
66+
- `user_id` (String)
67+
68+
69+
4070
<a id="nestedatt--cloud_settings"></a>
4171
### Nested Schema for `cloud_settings`
4272

@@ -71,7 +101,7 @@ Required:
71101

72102
Optional:
73103

74-
- `kubeconfig` (Attributes) (see [below for nested schema](#nestedatt--cloud_settings--byok--kubeconfig))
104+
- `kubeconfig` (Attributes, Deprecated) (see [below for nested schema](#nestedatt--cloud_settings--byok--kubeconfig))
75105

76106
<a id="nestedatt--cloud_settings--byok--kubeconfig"></a>
77107
### Nested Schema for `cloud_settings.byok.kubeconfig`
@@ -121,32 +151,39 @@ Required:
121151

122152

123153

124-
<a id="nestedatt--bindings"></a>
125-
### Nested Schema for `bindings`
154+
<a id="nestedatt--kubeconfig"></a>
155+
### Nested Schema for `kubeconfig`
126156

127157
Optional:
128158

129-
- `read` (Attributes Set) Read policies of this cluster. (see [below for nested schema](#nestedatt--bindings--read))
130-
- `write` (Attributes Set) Write policies of this cluster. (see [below for nested schema](#nestedatt--bindings--write))
131-
132-
<a id="nestedatt--bindings--read"></a>
133-
### Nested Schema for `bindings.read`
134-
135-
Optional:
159+
- `client_certificate` (String) The path to a client cert file for TLS. Can be sourced from `PLURAL_KUBE_CLIENT_CERT_DATA`.
160+
- `client_key` (String, Sensitive) The path to a client key file for TLS. Can be sourced from `PLURAL_KUBE_CLIENT_KEY_DATA`.
161+
- `cluster_ca_certificate` (String) The path to a cert file for the certificate authority. Can be sourced from `PLURAL_KUBE_CLUSTER_CA_CERT_DATA`.
162+
- `config_context` (String) kubeconfig context to use. Can be sourced from `PLURAL_KUBE_CTX`.
163+
- `config_context_auth_info` (String) Can be sourced from `PLURAL_KUBE_CTX_AUTH_INFO`.
164+
- `config_context_cluster` (String) Can be sourced from `PLURAL_KUBE_CTX_CLUSTER`.
165+
- `config_path` (String) Path to the kubeconfig file. Can be sourced from `PLURAL_KUBE_CONFIG_PATH`.
166+
- `exec` (Attributes List) Specifies a command to provide client credentials (see [below for nested schema](#nestedatt--kubeconfig--exec))
167+
- `host` (String) The complete address of the Kubernetes cluster, using scheme://hostname:port format. Can be sourced from `PLURAL_KUBE_HOST`.
168+
- `insecure` (Boolean) Skips the validity check for the server's certificate. This will make your HTTPS connections insecure. Can be sourced from `PLURAL_KUBE_INSECURE`.
169+
- `password` (String, Sensitive) The password for basic authentication to the Kubernetes cluster. Can be sourced from `PLURAL_KUBE_PASSWORD`.
170+
- `proxy_url` (String) The URL to the proxy to be used for all requests made by this client. Can be sourced from `PLURAL_KUBE_PROXY_URL`.
171+
- `tls_server_name` (String) TLS server name is used to check server certificate. If it is empty, the hostname used to contact the server is used. Can be sourced from `PLURAL_KUBE_TLS_SERVER_NAME`.
172+
- `token` (String, Sensitive) Token is the bearer token for authentication to the Kubernetes cluster. Can be sourced from `PLURAL_KUBE_TOKEN`.
173+
- `username` (String) The username for basic authentication to the Kubernetes cluster. Can be sourced from `PLURAL_KUBE_USER`.
136174

137-
- `group_id` (String)
138-
- `id` (String)
139-
- `user_id` (String)
175+
<a id="nestedatt--kubeconfig--exec"></a>
176+
### Nested Schema for `kubeconfig.exec`
140177

178+
Required:
141179

142-
<a id="nestedatt--bindings--write"></a>
143-
### Nested Schema for `bindings.write`
180+
- `api_version` (String) Preferred input version.
181+
- `command` (String) Command to execute.
144182

145183
Optional:
146184

147-
- `group_id` (String)
148-
- `id` (String)
149-
- `user_id` (String)
185+
- `args` (List of String) Arguments to pass to the command when executing it.
186+
- `env` (Map of String) Defines environment variables to expose to the process.
150187

151188

152189

docs/resources/git_repository.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ GitRepository resource
2121

2222
### Optional
2323

24+
- `decrypt` (Boolean) If set to `true` then runs `plural crypto unlock` on the repo after clone.
2425
- `https_path` (String) Manually supplied https path for non standard git setups. This is auto-inferred in many cases.
2526
- `passphrase` (String, Sensitive) Passphrase to decrypt the given private key.
2627
- `password` (String, Sensitive) HTTP password for http authenticated repos.

docs/resources/service_deployment.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ description: |-
2424
### Optional
2525

2626
- `bindings` (Attributes) Read and write policies of this ServiceDeployment. (see [below for nested schema](#nestedatt--bindings))
27-
- `configuration` (Attributes Set) List of [name, value] secrets used to alter this ServiceDeployment configuration. (see [below for nested schema](#nestedatt--configuration))
27+
- `configuration` (Map of String) Key-value configuration used to parameterize this service (stored securely by default).
2828
- `docs_path` (String) Path to the documentation in the target git repository.
2929
- `helm` (Attributes) Settings defining how Helm charts should be applied. (see [below for nested schema](#nestedatt--helm))
3030
- `kustomize` (Attributes) Kustomize related service metadata. (see [below for nested schema](#nestedatt--kustomize))
@@ -75,15 +75,6 @@ Optional:
7575

7676

7777

78-
<a id="nestedatt--configuration"></a>
79-
### Nested Schema for `configuration`
80-
81-
Required:
82-
83-
- `name` (String)
84-
- `value` (String, Sensitive)
85-
86-
8778
<a id="nestedatt--helm"></a>
8879
### Nested Schema for `helm`
8980

example/servicecontext/main.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
terraform {
2+
required_providers {
3+
plural = {
4+
source = "pluralsh/plural"
5+
version = "0.0.1"
6+
}
7+
}
8+
}
9+
10+
provider "plural" {
11+
use_cli = true
12+
}
13+
14+
resource "plural_service_context" "service_context" {
15+
name = "service-context-tf"
16+
configuration = {
17+
"env" = "prod"
18+
"test" = "some-value"
19+
}
20+
secrets = {
21+
"test" = "some-secret-value"
22+
}
23+
}

0 commit comments

Comments
 (0)