Fixes for AWS Terraform Deployment

This commit is contained in:
Vincent Schwarzer 2017-03-20 12:06:07 +01:00
parent 780b4e4d3c
commit ba9f17165e
5 changed files with 43 additions and 4 deletions

View file

@ -17,6 +17,14 @@ resource "aws_security_group_rule" "aws-allow-api-access" {
security_group_id = "${aws_security_group.aws-elb.id}" security_group_id = "${aws_security_group.aws-elb.id}"
} }
resource "aws_security_group_rule" "aws-allow-api-egress" {
type = "egress"
from_port = 0
to_port = 65535
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${aws_security_group.aws-elb.id}"
}
# Create a new AWS ELB for K8S API # Create a new AWS ELB for K8S API
resource "aws_elb" "aws-elb-api" { resource "aws_elb" "aws-elb-api" {

View file

@ -76,7 +76,7 @@ resource "aws_route_table" "kubernetes-private" {
vpc_id = "${aws_vpc.cluster-vpc.id}" vpc_id = "${aws_vpc.cluster-vpc.id}"
route { route {
cidr_block = "0.0.0.0/0" cidr_block = "0.0.0.0/0"
gateway_id = "${element(aws_nat_gateway.cluster-nat-gateway.*.id, count.index)}" nat_gateway_id = "${element(aws_nat_gateway.cluster-nat-gateway.*.id, count.index)}"
} }
tags { tags {
Name = "kubernetes-${var.aws_cluster_name}-routetable-private-${count.index}" Name = "kubernetes-${var.aws_cluster_name}-routetable-private-${count.index}"

View file

@ -1,6 +1,5 @@
#Global Vars #Global Vars
aws_cluster_name = "devtest" aws_cluster_name = "devtest"
aws_region = "eu-central-1"
#VPC Vars #VPC Vars
aws_vpc_cidr_block = "10.250.192.0/18" aws_vpc_cidr_block = "10.250.192.0/18"

View file

@ -0,0 +1,32 @@
#Global Vars
aws_cluster_name = "devtest"
aws_region = "eu-central-1"
#VPC Vars
aws_vpc_cidr_block = "10.250.192.0/18"
aws_cidr_subnets_private = ["10.250.192.0/20","10.250.208.0/20"]
aws_cidr_subnets_public = ["10.250.224.0/20","10.250.240.0/20"]
aws_avail_zones = ["eu-central-1a","eu-central-1b"]
#Bastion Host
aws_bastion_ami = "ami-5900cc36"
aws_bastion_size = "t2.small"
#Kubernetes Cluster
aws_kube_master_num = 3
aws_kube_master_size = "t2.medium"
aws_etcd_num = 3
aws_etcd_size = "t2.medium"
aws_kube_worker_num = 4
aws_kube_worker_size = "t2.medium"
aws_cluster_ami = "ami-903df7ff"
#Settings AWS ELB
aws_elb_api_port = 443
k8s_secure_api_port = 443

View file

@ -33,12 +33,12 @@ variable "aws_avail_zones" {
} }
variable "aws_cidr_subnets_private" { variable "aws_cidr_subnets_private" {
description = "CIDR Blocks for private subnets in Availability zones1" description = "CIDR Blocks for private subnets in Availability Zones"
type = "list" type = "list"
} }
variable "aws_cidr_subnets_public" { variable "aws_cidr_subnets_public" {
description = "CIDR Blocks for public subnets in Availability zones1" description = "CIDR Blocks for public subnets in Availability Zones"
type = "list" type = "list"
} }