Skip to content

Commit

Permalink
Lock minimum version of provider and add force_update_version (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincuber committed May 22, 2020
1 parent 3f4cf12 commit 0255844
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.1.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
Expand All @@ -18,7 +18,7 @@ repos:
args: ['--allow-missing-credentials']
- id: trailing-whitespace
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.29.0
rev: v1.30.0
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ This module will create EKS managed Node Group that will join your existing Kube

## Terraform versions

Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master` branch.
Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch.

## Usage

```hcl
module "eks-node-group" {
source = "umotif-public/eks-node-group/aws"
version = "~> 1.0.0"
version = "~> 2.0.0"
enabled = true
cluster_name = aws_eks_cluster.cluster.id
Expand All @@ -33,6 +33,8 @@ module "eks-node-group" {
lifecycle = "OnDemand"
}
force_update_version = true
tags = {
Environment = "test"
}
Expand All @@ -55,13 +57,15 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](http
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.
| Name | Version |
|------|---------|
| aws | ~> 2.63 |

## Providers

| Name | Version |
|------|---------|
| aws | n/a |
| aws | ~> 2.63 |
| random | n/a |

## Inputs
Expand All @@ -76,6 +80,7 @@ No requirements.
| 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` | `20` | no |
| ec2\_ssh\_key | SSH key name that should be used to access the worker nodes | `string` | `null` | no |
| enabled | Whether to create the resources. Set to `false` to prevent the module from creating any resources | `bool` | `true` | no |
| 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 | Set of instance types associated with the EKS Node Group. Defaults to ["t3.medium"]. Terraform will only perform drift detection if a configuration value is provided | `list(string)` | <pre>[<br> "t3.medium"<br>]</pre> | no |
| kubernetes\_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 |
| 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 |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ resource "aws_eks_node_group" "main" {
release_version = var.ami_release_version
version = var.kubernetes_version

force_update_version = var.force_update_version

tags = var.tags

scaling_config {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ variable "node_group_role_name" {
description = "The name of the cluster node group role. Defaults to <cluster_name>-managed-group-node"
default = ""
}

variable "force_update_version" {
type = bool
description = "Force version update if existing pods are unable to be drained due to a pod disruption budget issue."
default = false
}
5 changes: 5 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
terraform {
required_providers {
aws = "~> 2.63"
}
}

0 comments on commit 0255844

Please sign in to comment.