-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.tf
91 lines (74 loc) · 2.43 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
###### AWS Provider ######
provider "aws" {
region = "${var.aws_region}"
profile = "${var.aws_profile}"
}
terraform {
backend "s3" {
bucket = "your_s3_bucket" # example bucket.dev.itshellws-k8s.com
key = "terraform.tfstate"
region = "us-east-1"
profile = "virginia-kubernetes" #your keys in .ssh/virginia-kubernetes.pem , write here without .pem
}
}
###### VARIABLES ######
variable "aws_region" {
description = "AWS Region"
}
variable "aws_profile" {
description = "AWS Profile"
}
variable "product" {
description = "Product Name"
}
variable "env" {
description = "Environment"
}
variable "key" {
description = "Key for ssh"
}
variable "availability_zones" {
type = "list"
description = "List of AZ's"
}
variable "private_zones_count" {
description = "number about private zones"
default = "3"
}
variable "public_zones_count" {
description = "number about public zones"
default = "3"
}
locals {
name = "${var.product}_${var.env}"
tags = {
Env = "${var.env}"
Product = "${var.product}"
}
}
variable "external-ip" {
default = "201.211.207.87/32" #your public ip to access KUBERNETES API
}
variable "cluster_defaults" {
description = "Default values for target groups as defined by the list of maps."
type = "map"
default = {
name = "eks-cluster" # Name for the eks cluster.
}
}
###### ASG_PROPERTIES ######
variable "nodes_defaults" {
description = "Default values for target groups as defined by the list of maps."
type = "map"
default = {
name = "eks-nodes" # Name for the eks workers.
ami_id = "ami-dea4d5a1" # AMI ID for the eks workers. If none is provided, Terraform will searchfor the latest version of their EKS optimized worker AMI.
asg_desired_capacity = "2" # Desired worker capacity in the autoscaling group.
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
asg_min_size = "2" # Minimum worker capacity in the autoscaling group.
instance_type = "t2.small" # Size of the workers instances.
key_name = "virginia-kubernetes" # The key name that should be used for the instances in the autoscaling group
ebs_optimized = false # sets whether to use ebs optimization on supported types.
public_ip = false # Associate a public ip address with a worker
}
}