From 3202cb5f30c4d56f5ee9a49b1d8a6c996d9aaabf Mon Sep 17 00:00:00 2001 From: marcincuber Date: Mon, 21 Feb 2022 11:39:45 +0000 Subject: [PATCH] Add full module configuration with examples --- .pre-commit-config.yaml | 2 +- README.md | 62 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91d2bc5..5ff3c08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: args: ['--allow-missing-credentials'] - id: trailing-whitespace - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.64.0 + rev: 48bc03ca3f0f2f782d2f430069868019a6892062 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/README.md b/README.md index f0deecf..c8fe39e 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,67 @@ module "eks-node-group" { * [EKS Single Node Group with Launch Template](https://github.com/native-cube/terraform-aws-eks-node-group/tree/main/examples/single-node-group-with-launch-template) - +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0.0 | +| [aws](#requirement\_aws) | >= 4.0.0 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.0.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_eks_node_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group) | resource | +| [aws_iam_role.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [ami\_release\_version](#input\_ami\_release\_version) | AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version | `string` | `null` | no | +| [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. Valid values: AL2\_x86\_64 \| AL2\_x86\_64\_GPU \| AL2\_ARM\_64 \| CUSTOM \| BOTTLEROCKET\_ARM\_64 \| BOTTLEROCKET\_x86\_64. Terraform will only perform drift detection if a configuration value is provided. | `string` | `null` | no | +| [capacity\_type](#input\_capacity\_type) | Type of capacity associated with the EKS Node Group. Defaults to ON\_DEMAND. Valid values: ON\_DEMAND, SPOT. | `string` | `"ON_DEMAND"` | no | +| [cluster\_name](#input\_cluster\_name) | The name of the EKS cluster. | `string` | n/a | yes | +| [create\_iam\_role](#input\_create\_iam\_role) | Create IAM role for node group. Set to false if pass `node_role_arn` as an argument | `bool` | `true` | no | +| [desired\_size](#input\_desired\_size) | Desired number of worker nodes. | `number` | n/a | yes | +| [disk\_size](#input\_disk\_size) | Disk size in GiB for worker nodes. Defaults to 20. Terraform will only perform drift detection if a configuration value is provided. | `number` | `null` | no | +| [ec2\_ssh\_key](#input\_ec2\_ssh\_key) | EC2 Key Pair name that provides access for SSH communication with the worker nodes in the EKS Node Group. If you specify this configuration, but do not specify source\_security\_group\_ids when you create an EKS Node Group, port 22 on the worker nodes is opened to the Internet (0.0.0.0/0). | `string` | `null` | no | +| [enable\_iam\_role\_ssm\_policy](#input\_enable\_iam\_role\_ssm\_policy) | Enable addition of managed policy called `AmazonSSMManagedInstanceCore` to enable SSM monitoring. | `bool` | `true` | no | +| [force\_update\_version](#input\_force\_update\_version) | Force version update if existing pods are unable to be drained due to a pod disruption budget issue. | `bool` | `false` | no | +| [instance\_types](#input\_instance\_types) | List of instance types associated with the EKS Node Group. Terraform will only perform drift detection if a configuration value is provided | `list(string)` | `null` | no | +| [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version. Defaults to EKS Cluster Kubernetes version. Terraform will only perform drift detection if a configuration value is provided | `string` | `null` | no | +| [labels](#input\_labels) | Key-value mapping of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed | `map(string)` | `{}` | no | +| [launch\_template](#input\_launch\_template) | Configuration block with Launch Template settings. `name`, `id` and `version` parameters are available. | `map(string)` | `{}` | no | +| [max\_size](#input\_max\_size) | Maximum number of worker nodes. | `number` | n/a | yes | +| [min\_size](#input\_min\_size) | Minimum number of worker nodes. | `number` | n/a | yes | +| [node\_group\_name](#input\_node\_group\_name) | The name of the cluster node group. Defaults to - | `string` | `null` | no | +| [node\_group\_name\_prefix](#input\_node\_group\_name\_prefix) | Creates a unique name beginning with the specified prefix. Conflicts with node\_group\_name | `string` | `null` | no | +| [node\_group\_role\_name](#input\_node\_group\_role\_name) | The name of the cluster node group role. Defaults to -managed-group-node | `string` | `null` | no | +| [node\_role\_arn](#input\_node\_role\_arn) | IAM role arn that will be used by managed node group. | `string` | `null` | no | +| [source\_security\_group\_ids](#input\_source\_security\_group\_ids) | Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. If you specify ec2\_ssh\_key, but do not specify this configuration when you create an EKS Node Group, port 22 on the worker nodes is opened to the Internet (0.0.0.0/0) | `list(string)` | `null` | no | +| [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs to launch resources in. | `list(string)` | n/a | yes | +| [tags](#input\_tags) | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no | +| [taints](#input\_taints) | List of objects containing Kubernetes taints which will be applied to the nodes in the node group. Maximum of 50 taints per node group. | `list(object({ key = string, value = any, effect = string }))` | `[]` | no | +| [update\_config](#input\_update\_config) | Update config configuration block which is a key-value map. Accepted argmuents are `max_unavailable` and `max_unavailable_percentage`. | `map(any)` | `{}` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [iam\_role\_arn](#output\_iam\_role\_arn) | IAM role ARN used by node group. | +| [iam\_role\_id](#output\_iam\_role\_id) | IAM role ID used by node group. | +| [node\_group](#output\_node\_group) | Outputs from EKS node group. See `aws_eks_node_group` Terraform documentation for values | ## License