Commit 407bb010 authored by A-Gordon's avatar A-Gordon

Added tags to subnets for cloud-provider option in K8S

parent b5570009
Pipeline #1620 passed with stage
in 16 seconds
......@@ -31,6 +31,10 @@ variable "enable_dns_support" {
default = true
}
variable "kubernetes_cluster" {
description = "The name of the Kubernetes Cluster to tag the public and private subnets with, this is so that the cloud-provider function in Kubernetes can function."
}
resource "aws_vpc" "mod" {
cidr_block = "${var.cidr}"
enable_dns_hostnames = "${var.enable_dns_hostnames}"
......@@ -51,7 +55,9 @@ resource "aws_subnet" "public" {
map_public_ip_on_launch = true
tags {
Name = "${var.name}.public.${element(var.availability_zones, count.index)}"
Name = "${var.name}.public.${element(var.availability_zones, count.index)}"
KubernetesCluster = "${var.kubernetes_cluster}"
"kubernetes.io/role/elb" = "kubernetes.io/role/elb"
}
}
......@@ -64,7 +70,9 @@ resource "aws_subnet" "private" {
count = "${length(var.private_subnets)}"
tags {
Name = "${var.name}.private.${element(var.availability_zones, count.index)}"
Name = "${var.name}.private.${element(var.availability_zones, count.index)}"
KubernetesCluster = "${var.kubernetes_cluster}"
"kubernetes.io/role/internal-elb" = "kubernetes.io/role/internal-elb"
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment