-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.tf
52 lines (43 loc) · 1000 Bytes
/
config.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
terraform {
backend "s3" {
bucket = "rs-terraform-state"
key = "eks/test-cluster"
region = "us-east-1"
dynamodb_table = "rs-state-lock"
}
}
provider "aws" {
region = "${var.region}"
}
data "aws_region" "current" {}
# Declare the data source
data "aws_availability_zones" "available" {}
#Get latest ami for workers
data "aws_ami" "eks_worker" {
filter {
name = "name"
values = ["amazon-eks-node-v*"]
}
most_recent = true
owners = ["602401143452"] # Amazon EKS AMI Account ID
}
data "aws_iam_policy_document" "master_policy" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["eks.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "worker_node_policy" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
}