Skip to content

Commit 8571d10

Browse files
committed
Added support for TMC EKS cluster
Signed-off-by: Asutosh Palai <asupalai@gmail.com>
1 parent 043ccf1 commit 8571d10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6742
-7
lines changed

.golangci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ issues:
8686
linters:
8787
- gosec
8888
- nestif
89+
- path: flatten_test.go
90+
linters:
91+
- dupl

docs/data-sources/ekscluster.md

+223
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
---
2+
Title: "EKS Cluster Resource"
3+
Description: |-
4+
Reading the EKS cluster resource managed by Tanzu Mission Control.
5+
---
6+
7+
# EKS Cluster
8+
9+
The `tanzu-mission-control_ekscluster` resource allows you to provision and manage [AWS EKS](https://aws.amazon.com/eks/) through Tanzu Mission Control.
10+
It allows users to connect Tanzu Mission Control to their Amazon Web Services (AWS) account and create, update/upgrade, and delete EKS clusters and node groups (called node pools in Tanzu).
11+
12+
## Provisioning an EKS Cluster
13+
14+
To use the **Tanzu Mission Control** for creating a new cluster, you must first connect your AWS account to Tanzu Mission Control.
15+
For more information, see [connecting an AWS account for EKS cluster lifecycle management][aws-account]
16+
and [create an EKS Cluster][create-cluster].
17+
18+
You must also have the appropriate permissions in Tanzu Mission Control:
19+
20+
- To provision a cluster, you must have `cluster.admin` permissions.
21+
- You must also have `clustergroup.edit` permissions on the cluster group in which you want to put the new cluster.
22+
23+
[aws-account]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-E4627693-7D1A-4914-A9DF-61E49F97FECC.html
24+
[create-cluster]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-208B2A5A-AE08-4CE1-9DC0-EB573E4BA4A8.html?hWord=N4IghgNiBcIKIGkDKIC+Q
25+
26+
## Example Usage
27+
28+
```terraform
29+
# Read Tanzu Mission AWS EKS Control cluster : fetch cluster details
30+
data "tanzu-mission-control_ekscluster" "tf_eks_cluster" {
31+
credential_name = "test-aws-cred-name" // Required
32+
region = "us-west-2" // Required
33+
name = "test-cluster" // Required
34+
}
35+
```
36+
37+
<!-- schema generated by tfplugindocs -->
38+
## Schema
39+
40+
### Required
41+
42+
- `credential_name` (String) Name of the AWS Crendential in Tanzu Mission Control
43+
- `name` (String) Name of this cluster
44+
- `region` (String) AWS Region of the this cluster
45+
46+
### Optional
47+
48+
- `meta` (Block List, Max: 1) Metadata for the resource (see [below for nested schema](#nestedblock--meta))
49+
- `ready_wait_timeout` (String) Wait timeout duration until cluster resource reaches READY state. Accepted timeout duration values like 5s, 45m, or 3h, higher than zero
50+
- `spec` (Block List, Max: 1) Spec for the cluster (see [below for nested schema](#nestedblock--spec))
51+
52+
### Read-Only
53+
54+
- `id` (String) The ID of this resource.
55+
- `status` (Map of String) Status of the cluster
56+
57+
<a id="nestedblock--meta"></a>
58+
### Nested Schema for `meta`
59+
60+
Optional:
61+
62+
- `annotations` (Map of String) Annotations for the resource
63+
- `description` (String) Description of the resource
64+
- `labels` (Map of String) Labels for the resource
65+
66+
Read-Only:
67+
68+
- `resource_version` (String) Resource version of the resource
69+
- `uid` (String) UID of the resource
70+
71+
72+
<a id="nestedblock--spec"></a>
73+
### Nested Schema for `spec`
74+
75+
Required:
76+
77+
- `config` (Block List, Min: 1, Max: 1) EKS config for the cluster control plane (see [below for nested schema](#nestedblock--spec--config))
78+
- `nodepool` (Block List, Min: 1) Nodepool definitions for the cluster (see [below for nested schema](#nestedblock--spec--nodepool))
79+
80+
Optional:
81+
82+
- `cluster_group` (String) Name of the cluster group to which this cluster belongs
83+
- `proxy` (String) Optional proxy name is the name of the Proxy Config to be used for the cluster
84+
85+
<a id="nestedblock--spec--config"></a>
86+
### Nested Schema for `spec.config`
87+
88+
Required:
89+
90+
- `kubernetes_version` (String) Kubernetes version of the cluster
91+
- `role_arn` (String) ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations
92+
- `vpc` (Block List, Min: 1, Max: 1) VPC config (see [below for nested schema](#nestedblock--spec--config--vpc))
93+
94+
Optional:
95+
96+
- `kubernetes_network_config` (Block List, Max: 1) Kubernetes Network Config (see [below for nested schema](#nestedblock--spec--config--kubernetes_network_config))
97+
- `logging` (Block List, Max: 1) EKS logging configuration (see [below for nested schema](#nestedblock--spec--config--logging))
98+
- `tags` (Map of String) The metadata to apply to the cluster to assist with categorization and organization
99+
100+
<a id="nestedblock--spec--config--vpc"></a>
101+
### Nested Schema for `spec.config.vpc`
102+
103+
Required:
104+
105+
- `subnet_ids` (Set of String) Subnet ids used by the cluster
106+
107+
Optional:
108+
109+
- `enable_private_access` (Boolean) Enable private access on the cluster
110+
- `enable_public_access` (Boolean) Enable public access on the cluster
111+
- `public_access_cidrs` (Set of String) Public access cidrs
112+
- `security_groups` (Set of String) Security groups for the cluster VMs
113+
114+
115+
<a id="nestedblock--spec--config--kubernetes_network_config"></a>
116+
### Nested Schema for `spec.config.kubernetes_network_config`
117+
118+
Required:
119+
120+
- `service_cidr` (String) Service CIDR for Kubernetes services
121+
122+
123+
<a id="nestedblock--spec--config--logging"></a>
124+
### Nested Schema for `spec.config.logging`
125+
126+
Optional:
127+
128+
- `api_server` (Boolean) Enable API server logs
129+
- `audit` (Boolean) Enable audit logs
130+
- `authenticator` (Boolean) Enable authenticator logs
131+
- `controller_manager` (Boolean) Enable controller manager logs
132+
- `scheduler` (Boolean) Enable scheduler logs
133+
134+
135+
136+
<a id="nestedblock--spec--nodepool"></a>
137+
### Nested Schema for `spec.nodepool`
138+
139+
Required:
140+
141+
- `info` (Block List, Min: 1, Max: 1) Info for the nodepool (see [below for nested schema](#nestedblock--spec--nodepool--info))
142+
- `spec` (Block List, Min: 1, Max: 1) Spec for the cluster (see [below for nested schema](#nestedblock--spec--nodepool--spec))
143+
144+
<a id="nestedblock--spec--nodepool--info"></a>
145+
### Nested Schema for `spec.nodepool.info`
146+
147+
Required:
148+
149+
- `name` (String) Name of the nodepool, immutable
150+
151+
Optional:
152+
153+
- `description` (String) Description for the nodepool
154+
155+
156+
<a id="nestedblock--spec--nodepool--spec"></a>
157+
### Nested Schema for `spec.nodepool.spec`
158+
159+
Required:
160+
161+
- `role_arn` (String) ARN of the IAM role that provides permissions for the Kubernetes nodepool to make calls to AWS API operations, immutable
162+
- `subnet_ids` (Set of String) Subnets required for the nodepool
163+
164+
Optional:
165+
166+
- `ami_type` (String) AMI Type, immutable
167+
- `capacity_type` (String) Capacity Type
168+
- `instance_types` (Set of String) Nodepool instance types, immutable
169+
- `launch_template` (Block List, Max: 1) Launch template for the nodepool (see [below for nested schema](#nestedblock--spec--nodepool--spec--launch_template))
170+
- `node_labels` (Map of String) Kubernetes node labels
171+
- `remote_access` (Block List, Max: 1) Remote access to worker nodes, immutable (see [below for nested schema](#nestedblock--spec--nodepool--spec--remote_access))
172+
- `root_disk_size` (Number) Root disk size in GiB, immutable
173+
- `scaling_config` (Block List, Max: 1) Nodepool scaling config (see [below for nested schema](#nestedblock--spec--nodepool--spec--scaling_config))
174+
- `tags` (Map of String) EKS specific tags
175+
- `taints` (Block List) If specified, the node's taints (see [below for nested schema](#nestedblock--spec--nodepool--spec--taints))
176+
- `update_config` (Block List, Max: 1) Update config for the nodepool (see [below for nested schema](#nestedblock--spec--nodepool--spec--update_config))
177+
178+
<a id="nestedblock--spec--nodepool--spec--launch_template"></a>
179+
### Nested Schema for `spec.nodepool.spec.launch_template`
180+
181+
Optional:
182+
183+
- `id` (String) The ID of the launch template
184+
- `name` (String) The name of the launch template
185+
- `version` (String) The version of the launch template to use
186+
187+
188+
<a id="nestedblock--spec--nodepool--spec--remote_access"></a>
189+
### Nested Schema for `spec.nodepool.spec.remote_access`
190+
191+
Optional:
192+
193+
- `security_groups` (Set of String) Security groups for the VMs
194+
- `ssh_key` (String) SSH key for the nodepool VMs
195+
196+
197+
<a id="nestedblock--spec--nodepool--spec--scaling_config"></a>
198+
### Nested Schema for `spec.nodepool.spec.scaling_config`
199+
200+
Optional:
201+
202+
- `desired_size` (Number) Desired size of nodepool
203+
- `max_size` (Number) Maximum size of nodepool
204+
- `min_size` (Number) Minimum size of nodepool
205+
206+
207+
<a id="nestedblock--spec--nodepool--spec--taints"></a>
208+
### Nested Schema for `spec.nodepool.spec.taints`
209+
210+
Optional:
211+
212+
- `effect` (String) Current effect state of the node pool
213+
- `key` (String) The taint key to be applied to a node
214+
- `value` (String) The taint value corresponding to the taint key
215+
216+
217+
<a id="nestedblock--spec--nodepool--spec--update_config"></a>
218+
### Nested Schema for `spec.nodepool.spec.update_config`
219+
220+
Optional:
221+
222+
- `max_unavailable_nodes` (String) Maximum number of nodes unavailable at once during a version update
223+
- `max_unavailable_percentage` (String) Maximum percentage of nodes unavailable during a version update

0 commit comments

Comments
 (0)