adding tags I didnt realize were necessary

This commit is contained in:
brandoconnor
2018-06-06 22:17:12 -07:00
parent 283e9b203c
commit 6dab721b2e
2 changed files with 6 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ data "http" "workstation_external_ip" {
locals {
workstation_external_cidr = "${chomp(data.http.workstation_external_ip.body)}/32"
cluster_name = "test-eks-${random_string.suffix.result}"
tags = "${map("Environment", "test",
"GithubRepo", "terraform-aws-eks",
@@ -54,7 +55,7 @@ module "vpc" {
public_subnets = ["10.0.3.0/24", "10.0.4.0/24"]
enable_nat_gateway = true
single_nat_gateway = true
tags = "${local.tags}"
tags = "${merge(local.tags, map("kubernetes.io/cluster/${local.cluster_name}", "shared"))}"
}
module "security_group" {
@@ -67,7 +68,7 @@ module "security_group" {
module "eks" {
source = "../.."
cluster_name = "test-eks-${random_string.suffix.result}"
cluster_name = "${local.cluster_name}"
subnets = "${module.vpc.public_subnets}"
tags = "${local.tags}"
vpc_id = "${module.vpc.vpc_id}"

View File

@@ -9,6 +9,7 @@ resource "aws_autoscaling_group" "workers" {
tags = ["${concat(
list(
map("key", "Name", "value", "${var.cluster_name}-eks_asg", "propagate_at_launch", true),
map("key", "kubernetes.io/cluster/${var.cluster_name}", "value", "owned", "propagate_at_launch", true),
),
local.asg_tags)
}"]
@@ -32,7 +33,8 @@ resource "aws_security_group" "workers" {
name_prefix = "${var.cluster_name}"
description = "Security group for all nodes in the cluster."
vpc_id = "${var.vpc_id}"
tags = "${merge(var.tags, map("Name", "${var.cluster_name}-eks_worker_sg"))}"
tags = "${merge(var.tags, map("Name", "${var.cluster_name}-eks_worker_sg", "kubernetes.io/cluster/${var.cluster_name}", "owned"
))}"
}
resource "aws_security_group_rule" "workers_egress_internet" {