mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-15 08:14:12 +01:00
added the ability to optionally specify worker_image_id
This commit is contained in:
15
CHANGELOG.md
15
CHANGELOG.md
@@ -5,9 +5,22 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
|
||||
project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [[v0.2.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v0.1.1...v0.2.0)] - 2018-06-08]
|
||||
|
||||
### Changed
|
||||
|
||||
- `worker_ami_id` is now made optional. If not specified, the module will source the latest AWS supported EKS AMI instead.
|
||||
|
||||
## [[v0.1.1](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v0.1.0...v0.1.1)] - 2018-06-07]
|
||||
|
||||
### Changed
|
||||
|
||||
- pre-commit hooks fixed and working.
|
||||
- made progress on CI, advancing the build to the final `kitchen test` stage before failing.
|
||||
|
||||
## [v0.1.0] - 2018-06-07
|
||||
|
||||
### Added
|
||||
|
||||
- Everything! Initial release of the module.
|
||||
- Kudos to @tanmng for finding and fixing bug #1.
|
||||
- added a local variable to do a lookup against for a dynamic value in userdata which was previously static. Kudos to @tanmng for finding and fixing bug #1!
|
||||
|
||||
12
README.md
12
README.md
@@ -89,15 +89,15 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|:----:|:-----:|:-----:|
|
||||
| cluster_ingress_cidrs | The CIDRs from which we can execute kubectl commands. | list | - | yes |
|
||||
| cluster_name | Name of the EKS cluster. | string | - | yes |
|
||||
| cluster_name | Name of the EKS cluster which is also used as a prefix in names of related resources. | string | - | yes |
|
||||
| cluster_version | Kubernetes version to use for the cluster. | string | `1.10` | no |
|
||||
| subnets | A list of subnets to associate with the cluster's underlying instances. | list | - | yes |
|
||||
| tags | A map of tags to add to all resources | string | `<map>` | no |
|
||||
| tags | A map of tags to add to all resources. | string | `<map>` | no |
|
||||
| vpc_id | VPC id where the cluster and other resources will be deployed. | string | - | yes |
|
||||
| workers_ami_id | AMI ID for the eks workers. | string | - | yes |
|
||||
| workers_asg_desired_capacity | description | string | `1` | no |
|
||||
| workers_asg_max_size | description | string | `3` | no |
|
||||
| workers_asg_min_size | description | string | `1` | no |
|
||||
| workers_ami_id | AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI. | string | `` | no |
|
||||
| workers_asg_desired_capacity | Desired worker capacity in the autoscaling group. | string | `1` | no |
|
||||
| workers_asg_max_size | Maximum worker capacity in the autoscaling group. | string | `3` | no |
|
||||
| workers_asg_min_size | Minimum worker capacity in the autoscaling group. | string | `1` | no |
|
||||
| workers_instance_type | Size of the workers instances. | string | `m4.large` | no |
|
||||
|
||||
## Outputs
|
||||
|
||||
10
data.tf
10
data.tf
@@ -1,5 +1,15 @@
|
||||
data "aws_region" "current" {}
|
||||
|
||||
data "aws_ami" "eks_worker" {
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["eks-worker-*"]
|
||||
}
|
||||
|
||||
most_recent = true
|
||||
owners = ["602401143452"] # Amazon
|
||||
}
|
||||
|
||||
data "aws_iam_policy_document" "workers_assume_role_policy" {
|
||||
statement {
|
||||
sid = "EKSWorkerAssumeRole"
|
||||
|
||||
@@ -14,16 +14,6 @@ provider "random" {
|
||||
provider "http" {}
|
||||
provider "local" {}
|
||||
|
||||
data "aws_ami" "eks_worker" {
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["eks-worker-*"]
|
||||
}
|
||||
|
||||
most_recent = true
|
||||
owners = ["602401143452"] # Amazon
|
||||
}
|
||||
|
||||
data "aws_availability_zones" "available" {}
|
||||
|
||||
data "http" "workstation_external_ip" {
|
||||
@@ -75,7 +65,6 @@ module "eks" {
|
||||
subnets = "${module.vpc.public_subnets}"
|
||||
tags = "${local.tags}"
|
||||
vpc_id = "${module.vpc.vpc_id}"
|
||||
workers_ami_id = "${data.aws_ami.eks_worker.id}"
|
||||
cluster_ingress_cidrs = ["${local.workstation_external_cidr}"]
|
||||
workers_instance_type = "t2.small"
|
||||
}
|
||||
|
||||
13
variables.tf
13
variables.tf
@@ -4,7 +4,7 @@ variable "cluster_ingress_cidrs" {
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
description = "Name of the EKS cluster."
|
||||
description = "Name of the EKS cluster which is also used as a prefix in names of related resources."
|
||||
}
|
||||
|
||||
variable "cluster_version" {
|
||||
@@ -18,7 +18,7 @@ variable "subnets" {
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
description = "A map of tags to add to all resources"
|
||||
description = "A map of tags to add to all resources."
|
||||
default = {}
|
||||
}
|
||||
|
||||
@@ -27,21 +27,22 @@ variable "vpc_id" {
|
||||
}
|
||||
|
||||
variable "workers_ami_id" {
|
||||
description = "AMI ID for the eks workers."
|
||||
description = "AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI."
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "workers_asg_desired_capacity" {
|
||||
description = "description"
|
||||
description = "Desired worker capacity in the autoscaling group."
|
||||
default = "1"
|
||||
}
|
||||
|
||||
variable "workers_asg_max_size" {
|
||||
description = "description"
|
||||
description = "Maximum worker capacity in the autoscaling group."
|
||||
default = "3"
|
||||
}
|
||||
|
||||
variable "workers_asg_min_size" {
|
||||
description = "description"
|
||||
description = "Minimum worker capacity in the autoscaling group."
|
||||
default = "1"
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ resource "aws_launch_configuration" "workers" {
|
||||
associate_public_ip_address = true
|
||||
name_prefix = "${var.cluster_name}"
|
||||
iam_instance_profile = "${aws_iam_instance_profile.workers.name}"
|
||||
image_id = "${var.workers_ami_id}"
|
||||
image_id = "${var.workers_ami_id == "" ? data.aws_ami.eks_worker.id : var.workers_ami_id}"
|
||||
instance_type = "${var.workers_instance_type}"
|
||||
security_groups = ["${aws_security_group.workers.id}"]
|
||||
user_data_base64 = "${base64encode(local.workers_userdata)}"
|
||||
|
||||
Reference in New Issue
Block a user