Skip to content

Commit dfe77af

Browse files
added config files to local test space on converge
1 parent 22b9706 commit dfe77af

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
.kitchen.local.yml
88
Gemfile.lock
99
terraform.tfstate.d/
10+
config
11+
config-map-aws-auth.yaml

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ script:
2626
- echo 'script'
2727
- terraform init
2828
- terraform fmt -check=true
29-
- terraform validate -var "region=${AWS_REGION}" -var "subnets=[]" -var "workers_ami_id=ami-123456" -var "cluster_ingress_cidrs=[]" -var "cluster_name=test_cluster"
29+
- 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"
3030
- docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues
3131
- cd examples/eks_test_fixture
3232
- terraform init

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ A terraform module to create a managed Kubernetes cluster on AWS EKS. Available
44
through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
55
Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
66
and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
7+
Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
8+
can help guide you through connecting to the cluster via `kubectl`.
79

810
| Branch | Build status |
911
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -104,5 +106,5 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
104106
| cluster_id | The name/id of the cluster. |
105107
| cluster_security_group_ids | description |
106108
| cluster_version | The Kubernetes server version for the cluster. |
107-
| config_map_aws_auth | |
109+
| config_map_aws_auth | A kubernetes configuration to authenticate to this cluster. |
108110
| kubeconfig | kubectl config file contents for this cluster. |

examples/eks_test_fixture/main.tf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ resource "random_string" "suffix" {
4545
special = false
4646
}
4747

48+
resource "local_file" "config" {
49+
content = "${module.eks.kubeconfig}"
50+
filename = "${path.module}/config"
51+
}
52+
53+
resource "local_file" "config-map-aws-auth" {
54+
content = "${module.eks.config_map_aws_auth}"
55+
filename = "${path.module}/config-map-aws-auth.yaml"
56+
}
57+
4858
module "vpc" {
4959
source = "terraform-aws-modules/vpc/aws"
5060
version = "1.14.0"
5161
name = "test-vpc"
5262
cidr = "10.0.0.0/16"
53-
azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}"]
54-
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
55-
public_subnets = ["10.0.3.0/24", "10.0.4.0/24"]
63+
azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"]
64+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
65+
public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
5666
enable_nat_gateway = true
5767
single_nat_gateway = true
5868
tags = "${merge(local.tags, map("kubernetes.io/cluster/${local.cluster_name}", "shared"))}"

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
66
* Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
77
* and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
8+
* Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
9+
* can help guide you through connecting to the cluster via `kubectl`.
810
911
* | Branch | Build status |
1012
* | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
output "config_map_aws_auth" {
2-
description = ""
2+
description = "A kubernetes configuration to authenticate to this cluster."
33
value = "${local.config_map_aws_auth}"
44
}
55

0 commit comments

Comments
 (0)