File tree 15 files changed +720
-26
lines changed 15 files changed +720
-26
lines changed Original file line number Diff line number Diff line change 56
56
- [ 122 - How to send AWS CloudWatch Alarms to Slack?] ( ../lessons/122 )
57
57
- [ 123 - Creating a Linux service with systemd] ( ../lessons/123 )
58
58
- [ 124 - AWS Lambda Go vs. Node.js performance benchmark] ( ../lessons/124 )
59
+ - [ 125 - How to create EKS Cluster using Terraform MODULES?] ( ../lessons/125 )
Original file line number Diff line number Diff line change 18
18
}
19
19
20
20
resource "aws_iam_policy" "nodejs_s3_bucket_access" {
21
- name = " NodejsS3BucketAccess"
21
+ name = " NodejsS3BucketAccess"
22
22
23
23
policy = jsonencode ({
24
24
Version = " 2012-10-17"
@@ -35,23 +35,23 @@ resource "aws_iam_policy" "nodejs_s3_bucket_access" {
35
35
}
36
36
37
37
resource "aws_iam_policy" "nodejs_dynamodb_access" {
38
- name = " NodejsDynamoDBAccess"
38
+ name = " NodejsDynamoDBAccess"
39
39
40
40
policy = jsonencode ({
41
41
Version = " 2012-10-17"
42
42
Statement = [
43
43
{
44
44
Action = [
45
- " dynamodb:GetItem" ,
46
- " dynamodb:DeleteItem" ,
47
- " dynamodb:PutItem" ,
48
- " dynamodb:Scan" ,
49
- " dynamodb:Query" ,
50
- " dynamodb:UpdateItem" ,
51
- " dynamodb:BatchWriteItem" ,
52
- " dynamodb:BatchGetItem" ,
53
- " dynamodb:DescribeTable" ,
54
- " dynamodb:ConditionCheckItem"
45
+ " dynamodb:GetItem" ,
46
+ " dynamodb:DeleteItem" ,
47
+ " dynamodb:PutItem" ,
48
+ " dynamodb:Scan" ,
49
+ " dynamodb:Query" ,
50
+ " dynamodb:UpdateItem" ,
51
+ " dynamodb:BatchWriteItem" ,
52
+ " dynamodb:BatchGetItem" ,
53
+ " dynamodb:DescribeTable" ,
54
+ " dynamodb:ConditionCheckItem"
55
55
]
56
56
Effect = " Allow"
57
57
Resource = " arn:aws:dynamodb:*:*:table/Meta"
@@ -83,7 +83,7 @@ resource "aws_lambda_function" "nodejs" {
83
83
84
84
environment {
85
85
variables = {
86
- BUCKET_NAME = aws_s3_bucket.images_bucket.id
86
+ BUCKET_NAME = aws_s3_bucket.images_bucket.id
87
87
}
88
88
}
89
89
Original file line number Diff line number Diff line change 18
18
}
19
19
20
20
resource "aws_iam_policy" "go_s3_bucket_access" {
21
- name = " goS3BucketAccess"
21
+ name = " goS3BucketAccess"
22
22
23
23
policy = jsonencode ({
24
24
Version = " 2012-10-17"
@@ -35,23 +35,23 @@ resource "aws_iam_policy" "go_s3_bucket_access" {
35
35
}
36
36
37
37
resource "aws_iam_policy" "go_dynamodb_access" {
38
- name = " goDynamoDBAccess"
38
+ name = " goDynamoDBAccess"
39
39
40
40
policy = jsonencode ({
41
41
Version = " 2012-10-17"
42
42
Statement = [
43
43
{
44
44
Action = [
45
- " dynamodb:GetItem" ,
46
- " dynamodb:DeleteItem" ,
47
- " dynamodb:PutItem" ,
48
- " dynamodb:Scan" ,
49
- " dynamodb:Query" ,
50
- " dynamodb:UpdateItem" ,
51
- " dynamodb:BatchWriteItem" ,
52
- " dynamodb:BatchGetItem" ,
53
- " dynamodb:DescribeTable" ,
54
- " dynamodb:ConditionCheckItem"
45
+ " dynamodb:GetItem" ,
46
+ " dynamodb:DeleteItem" ,
47
+ " dynamodb:PutItem" ,
48
+ " dynamodb:Scan" ,
49
+ " dynamodb:Query" ,
50
+ " dynamodb:UpdateItem" ,
51
+ " dynamodb:BatchWriteItem" ,
52
+ " dynamodb:BatchGetItem" ,
53
+ " dynamodb:DescribeTable" ,
54
+ " dynamodb:ConditionCheckItem"
55
55
]
56
56
Effect = " Allow"
57
57
Resource = " arn:aws:dynamodb:*:*:table/Meta"
@@ -83,7 +83,7 @@ resource "aws_lambda_function" "go" {
83
83
84
84
environment {
85
85
variables = {
86
- BUCKET_NAME = aws_s3_bucket.images_bucket.id
86
+ BUCKET_NAME = aws_s3_bucket.images_bucket.id
87
87
}
88
88
}
89
89
Original file line number Diff line number Diff line change
1
+ # How to create EKS Cluster using Terraform MODULES (AWS Load Balancer Controller + Autoscaler + IRSA)
2
+
3
+ You can find tutorial [ here] ( https://antonputra.com/amazon/create-eks-cluster-using-terraform-modules/ ) .
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : apps/v1
3
+ kind : Deployment
4
+ metadata :
5
+ name : echoserver
6
+ namespace : default
7
+ spec :
8
+ selector :
9
+ matchLabels :
10
+ app : echoserver
11
+ replicas : 1
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : echoserver
16
+ spec :
17
+ containers :
18
+ - image : k8s.gcr.io/e2e-test-images/echoserver:2.5
19
+ name : echoserver
20
+ ports :
21
+ - containerPort : 8080
22
+ ---
23
+ apiVersion : v1
24
+ kind : Service
25
+ metadata :
26
+ name : echoserver
27
+ namespace : default
28
+ spec :
29
+ ports :
30
+ - port : 8080
31
+ protocol : TCP
32
+ type : ClusterIP
33
+ selector :
34
+ app : echoserver
35
+ ---
36
+ apiVersion : networking.k8s.io/v1
37
+ kind : Ingress
38
+ metadata :
39
+ name : echoserver
40
+ namespace : default
41
+ annotations :
42
+ alb.ingress.kubernetes.io/scheme : internet-facing
43
+ alb.ingress.kubernetes.io/target-type : ip
44
+ spec :
45
+ ingressClassName : alb
46
+ rules :
47
+ - host : echo.devopsbyexample.io
48
+ http :
49
+ paths :
50
+ - path : /
51
+ pathType : Exact
52
+ backend :
53
+ service :
54
+ name : echoserver
55
+ port :
56
+ number : 8080
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : apps/v1
3
+ kind : Deployment
4
+ metadata :
5
+ name : nginx-deployment
6
+ spec :
7
+ replicas : 4
8
+ selector :
9
+ matchLabels :
10
+ app : nginx
11
+ template :
12
+ metadata :
13
+ labels :
14
+ app : nginx
15
+ spec :
16
+ containers :
17
+ - name : nginx
18
+ image : nginx:1.14.2
19
+ resources :
20
+ requests :
21
+ cpu : " 1"
Original file line number Diff line number Diff line change
1
+ provider "aws" {
2
+ region = " us-east-1"
3
+ }
4
+
5
+ terraform {
6
+ required_providers {
7
+ kubectl = {
8
+ source = " gavinbunney/kubectl"
9
+ version = " >= 1.14.0"
10
+ }
11
+ helm = {
12
+ source = " hashicorp/helm"
13
+ version = " >= 2.6.0"
14
+ }
15
+ }
16
+
17
+ required_version = " ~> 1.0"
18
+ }
Original file line number Diff line number Diff line change
1
+ module "vpc" {
2
+ source = " terraform-aws-modules/vpc/aws"
3
+ version = " 3.14.3"
4
+
5
+ name = " main"
6
+ cidr = " 10.0.0.0/16"
7
+
8
+ azs = [" us-east-1a" , " us-east-1b" ]
9
+ private_subnets = [" 10.0.0.0/19" , " 10.0.32.0/19" ]
10
+ public_subnets = [" 10.0.64.0/19" , " 10.0.96.0/19" ]
11
+
12
+ public_subnet_tags = {
13
+ " kubernetes.io/role/elb" = " 1"
14
+ }
15
+ private_subnet_tags = {
16
+ " kubernetes.io/role/internal-elb" = " 1"
17
+ }
18
+
19
+ enable_nat_gateway = true
20
+ single_nat_gateway = true
21
+ one_nat_gateway_per_az = false
22
+
23
+ enable_dns_hostnames = true
24
+ enable_dns_support = true
25
+
26
+ tags = {
27
+ Environment = " staging"
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments