mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-22 09:29:06 +01:00
Add ability to pass computed values to cluster_security_group_id and worker_security_group_id (#186)
* Add ability to pass computer values to cluster_security_group_id and worker_security_group_id * Fix contributer name in CHANGELOG.md * Format variables.tf file
This commit is contained in:
committed by
Max Williams
parent
1822a677dc
commit
9d6740e116
10
workers.tf
10
workers.tf
@@ -55,7 +55,7 @@ resource "aws_security_group" "workers" {
|
||||
name_prefix = "${aws_eks_cluster.this.name}"
|
||||
description = "Security group for all nodes in the cluster."
|
||||
vpc_id = "${var.vpc_id}"
|
||||
count = "${var.worker_security_group_id == "" ? 1 : 0}"
|
||||
count = "${var.worker_create_security_group ? 1 : 0}"
|
||||
tags = "${merge(var.tags, map("Name", "${aws_eks_cluster.this.name}-eks_worker_sg", "kubernetes.io/cluster/${aws_eks_cluster.this.name}", "owned"
|
||||
))}"
|
||||
}
|
||||
@@ -68,7 +68,7 @@ resource "aws_security_group_rule" "workers_egress_internet" {
|
||||
from_port = 0
|
||||
to_port = 0
|
||||
type = "egress"
|
||||
count = "${var.worker_security_group_id == "" ? 1 : 0}"
|
||||
count = "${var.worker_create_security_group ? 1 : 0}"
|
||||
}
|
||||
|
||||
resource "aws_security_group_rule" "workers_ingress_self" {
|
||||
@@ -79,7 +79,7 @@ resource "aws_security_group_rule" "workers_ingress_self" {
|
||||
from_port = 0
|
||||
to_port = 65535
|
||||
type = "ingress"
|
||||
count = "${var.worker_security_group_id == "" ? 1 : 0}"
|
||||
count = "${var.worker_create_security_group ? 1 : 0}"
|
||||
}
|
||||
|
||||
resource "aws_security_group_rule" "workers_ingress_cluster" {
|
||||
@@ -90,7 +90,7 @@ resource "aws_security_group_rule" "workers_ingress_cluster" {
|
||||
from_port = "${var.worker_sg_ingress_from_port}"
|
||||
to_port = 65535
|
||||
type = "ingress"
|
||||
count = "${var.worker_security_group_id == "" ? 1 : 0}"
|
||||
count = "${var.worker_create_security_group ? 1 : 0}"
|
||||
}
|
||||
|
||||
resource "aws_security_group_rule" "workers_ingress_cluster_https" {
|
||||
@@ -101,7 +101,7 @@ resource "aws_security_group_rule" "workers_ingress_cluster_https" {
|
||||
from_port = 443
|
||||
to_port = 443
|
||||
type = "ingress"
|
||||
count = "${var.worker_security_group_id == "" ? 1 : 0}"
|
||||
count = "${var.worker_create_security_group ? 1 : 0}"
|
||||
}
|
||||
|
||||
resource "aws_iam_role" "workers" {
|
||||
|
||||
Reference in New Issue
Block a user