From dfe77afc7f54275a4a58472eb89ae314f8fef011 Mon Sep 17 00:00:00 2001 From: brandoconnor Date: Thu, 7 Jun 2018 00:25:15 -0700 Subject: [PATCH] added config files to local test space on converge --- .gitignore | 2 ++ .travis.yml | 2 +- README.md | 4 +++- examples/eks_test_fixture/main.tf | 16 +++++++++++++--- main.tf | 2 ++ outputs.tf | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index af980e5..b7a9d70 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ .kitchen.local.yml Gemfile.lock terraform.tfstate.d/ +config +config-map-aws-auth.yaml diff --git a/.travis.yml b/.travis.yml index ca7f3ba..757f5fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ script: - echo 'script' - terraform init - terraform fmt -check=true -- terraform validate -var "region=${AWS_REGION}" -var "subnets=[]" -var "workers_ami_id=ami-123456" -var "cluster_ingress_cidrs=[]" -var "cluster_name=test_cluster" +- terraform validate -var "region=${AWS_REGION}" -var "vpc_id=vpc-123456" -var "subnets=[]" -var "workers_ami_id=ami-123456" -var "cluster_ingress_cidrs=[]" -var "cluster_name=test_cluster" - docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues - cd examples/eks_test_fixture - terraform init diff --git a/README.md b/README.md index 63f0392..6bc8b03 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A terraform module to create a managed Kubernetes cluster on AWS EKS. Available through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws). Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html) and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started). +Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/) +can help guide you through connecting to the cluster via `kubectl`. | Branch | Build status | | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -104,5 +106,5 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | cluster_id | The name/id of the cluster. | | cluster_security_group_ids | description | | cluster_version | The Kubernetes server version for the cluster. | -| config_map_aws_auth | | +| config_map_aws_auth | A kubernetes configuration to authenticate to this cluster. | | kubeconfig | kubectl config file contents for this cluster. | diff --git a/examples/eks_test_fixture/main.tf b/examples/eks_test_fixture/main.tf index e7d7d04..c156460 100644 --- a/examples/eks_test_fixture/main.tf +++ b/examples/eks_test_fixture/main.tf @@ -45,14 +45,24 @@ resource "random_string" "suffix" { special = false } +resource "local_file" "config" { + content = "${module.eks.kubeconfig}" + filename = "${path.module}/config" +} + +resource "local_file" "config-map-aws-auth" { + content = "${module.eks.config_map_aws_auth}" + filename = "${path.module}/config-map-aws-auth.yaml" +} + module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "1.14.0" name = "test-vpc" cidr = "10.0.0.0/16" - azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}"] - private_subnets = ["10.0.1.0/24", "10.0.2.0/24"] - public_subnets = ["10.0.3.0/24", "10.0.4.0/24"] + azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"] + private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] + public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] enable_nat_gateway = true single_nat_gateway = true tags = "${merge(local.tags, map("kubernetes.io/cluster/${local.cluster_name}", "shared"))}" diff --git a/main.tf b/main.tf index 8daccfa..87ab712 100644 --- a/main.tf +++ b/main.tf @@ -5,6 +5,8 @@ * through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws). * Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html) * and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started). +* Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/) +* can help guide you through connecting to the cluster via `kubectl`. * | Branch | Build status | * | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/outputs.tf b/outputs.tf index f2984a0..5880fca 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,5 +1,5 @@ output "config_map_aws_auth" { - description = "" + description = "A kubernetes configuration to authenticate to this cluster." value = "${local.config_map_aws_auth}" }