Skip to content

Commit c1ebd58

Browse files
Merge branch 'master' into kubeconfig-updates
2 parents e955c17 + c0726f8 commit c1ebd58

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ A full example leveraging other community modules is contained in the [examples/
2424
```hcl
2525
module "eks" {
2626
source = "terraform-aws-modules/eks/aws"
27-
version = "0.1.0"
2827
cluster_name = "test-eks-cluster"
2928
subnets = ["subnet-abcde012", "subnet-bcde012a"]
3029
tags = "${map("Environment", "test")}"
@@ -100,18 +99,19 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
10099
| cluster_version | Kubernetes version to use for the EKS cluster. | string | `1.10` | no |
101100
| config_output_path | Determines where config files are placed if using configure_kubectl_session and you want config files to land outside the current working directory. | string | `./` | no |
102101
| configure_kubectl_session | Configure the current session's kubectl to use the instantiated EKS cluster. | string | `true` | no |
102+
| kubeconfig_context_name | Name of the kubeconfig context. | map | `aws` | no |
103+
| kubeconfig_user_name | Name of the kubeconfig user. | map | `aws` | no |
104+
| kubeconfig_aws_authenticator_command | Command to use to to fetch AWS EKS credentials | map | `heptio-authenticator-aws` | no |
105+
| kubeconfig_aws_authenticator_additional_args | Any additional arguments to pass to the authenticator such as the role to assume `["-r", "MyEksRole"]` | map | `<list>` | no |
106+
| kubeconfig_aws_authenticator_env_variables | Environment variables that should be used when executing the authenticator i.e. `{ AWS_PROFILE = "eks"}` | map | `<map>` | no |
103107
| subnets | A list of subnets to place the EKS cluster and workers within. | list | - | yes |
104108
| tags | A map of tags to add to all resources. | string | `<map>` | no |
105109
| vpc_id | VPC where the cluster and workers will be deployed. | string | - | yes |
106110
| worker_groups | A list of maps defining worker group configurations. See workers_group_defaults for valid keys. | list | `<list>` | no |
107111
| worker_security_group_id | If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the EKS cluster. | string | `` | no |
108112
| worker_sg_ingress_from_port | Minimum port number from which pods will accept communication. Must be changed to a lower value if some pods in your cluster will expose a port lower than 1025 (e.g. 22, 80, or 443). | string | `1025` | no |
109113
| workers_group_defaults | Default values for target groups as defined by the list of maps. | map | `<map>` | no |
110-
| kubeconfig_context_name | Name of the kubeconfig context. | map | `aws` | no |
111-
| kubeconfig_user_name | Name of the kubeconfig user. | map | `aws` | no |
112-
| kubeconfig_aws_authenticator_command | Command to use to to fetch AWS EKS credentials | map | `heptio-authenticator-aws` | no |
113-
| kubeconfig_aws_authenticator_additional_args | Any additional arguments to pass to the authenticator such as the role to assume `["-r", "MyEksRole"]` | map | `<list>` | no |
114-
| kubeconfig_aws_authenticator_env_variables | Environment variables that should be used when executing the authenticator i.e. `{ AWS_PROFILE = "eks"}` | map | `<map>` | no |
114+
| workstation_cidr | Override the default ingress rule that allows communication with the EKS cluster API. If not given, will use current IP/32. | string | - | no |
115115

116116
## Outputs
117117

cluster.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
4545
}
4646

4747
resource "aws_security_group_rule" "cluster_https_cidr_ingress" {
48-
cidr_blocks = ["${local.workstation_external_cidr}"]
48+
cidr_blocks = ["${local.workstation_cidr}"]
4949
description = "Allow kubectl communication with the EKS cluster API."
5050
protocol = "tcp"
5151
security_group_id = "${aws_security_group.cluster.id}"

local.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ locals {
33
cluster_security_group_id = "${var.cluster_security_group_id == "" ? aws_security_group.cluster.id : var.cluster_security_group_id}"
44
worker_security_group_id = "${var.worker_security_group_id == "" ? aws_security_group.workers.id : var.worker_security_group_id}"
55
workstation_external_cidr = "${chomp(data.http.workstation_external_ip.body)}/32"
6+
workstation_cidr = "${coalesce(var.workstation_cidr, local.workstation_external_cidr)}"
67

78
# Mapping from the node type that we selected and the max number of pods that it can run
89
# Taken from https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/amazon-eks-nodegroup.yaml

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ variable "cluster_security_group_id" {
77
default = ""
88
}
99

10+
variable "workstation_cidr" {
11+
description = "Override the default ingress rule that allows communication with the EKS cluster API. If not given, will use current IP/32. "
12+
default = ""
13+
}
14+
1015
variable "cluster_version" {
1116
description = "Kubernetes version to use for the EKS cluster."
1217
default = "1.10"

0 commit comments

Comments
 (0)