Skip to content

Commit 405e170

Browse files
Adding aws_iam_service_linked_role to fix ELB creation error (#91)
* adding aws_iam_service_linked_role to fix ELB creation error * setting default to false * updating changelog * moving resource to cluster.tf file
1 parent 2364795 commit 405e170

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1212
- add spot_price option to aws_launch_configuration
1313
- add enable_monitoring option to aws_launch_configuration
1414
- add t3 instance class settings
15+
- add aws_iam_service_linked_role for elasticloadbalancing. (by @max-rocket-internet)
1516
- Added autoscaling policies into module that are optionally attached when enabled for a worker group. (by @max-rocket-internet)
1617

1718
### Changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
102102
| cluster_security_group_id | If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the workers and provide API access to your current IP/32. | string | `` | no |
103103
| cluster_version | Kubernetes version to use for the EKS cluster. | string | `1.10` | no |
104104
| 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. Should end in a forward slash / . | string | `./` | no |
105+
| create_elb_service_linked_role | Whether to create the service linked role for the elasticloadbalancing service. Without this EKS cannot create ELBs. | string | `false` | no |
105106
| kubeconfig_aws_authenticator_additional_args | Any additional arguments to pass to the authenticator such as the role to assume. e.g. ["-r", "MyEksRole"]. | list | `<list>` | no |
106107
| kubeconfig_aws_authenticator_command | Command to use to to fetch AWS EKS credentials. | string | `aws-iam-authenticator` | no |
107108
| kubeconfig_aws_authenticator_env_variables | Environment variables that should be used when executing the authenticator. e.g. { AWS_PROFILE = "eks"}. | map | `<map>` | no |

cluster.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ resource "aws_iam_role_policy_attachment" "cluster_AmazonEKSServicePolicy" {
5858
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
5959
role = "${aws_iam_role.cluster.name}"
6060
}
61+
62+
resource "aws_iam_service_linked_role" "elasticloadbalancing" {
63+
count = "${var.create_elb_service_linked_role}"
64+
aws_service_name = "elasticloadbalancing.amazonaws.com"
65+
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "write_kubeconfig" {
2222
default = true
2323
}
2424

25+
variable "create_elb_service_linked_role" {
26+
description = "Whether to create the service linked role for the elasticloadbalancing service. Without this EKS cannot create ELBs."
27+
default = false
28+
}
29+
2530
variable "manage_aws_auth" {
2631
description = "Whether to write and apply the aws-auth configmap file."
2732
default = true

0 commit comments

Comments
 (0)