This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| variable "vpc_cidr_block" { | |
| description = "CIDR block for the VPC" | |
| default = "10.0.0.0/16" | |
| type = string | |
| } | |
| variable "private_subnets_cidr_blocks" { | |
| description = "CIDR block for the private subnet" | |
| default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | |
| type = list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "aws" { | |
| region = "us-east-2" | |
| } | |
| data "aws_availability_zones" "azs" {} | |
| module "myapp-vpc" { | |
| source = "terraform-aws-modules/vpc/aws" | |
| version = "3.7.0" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "aws" { | |
| region = "us-east-2" | |
| } | |
| data "aws_availability_zones" "azs" {} | |
| module "myapp-vpc" { | |
| source = "terraform-aws-modules/vpc/aws" | |
| version = "3.7.0" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module "eks" { | |
| source = "terraform-aws-modules/eks/aws" | |
| version = "17.20.0" | |
| # insert the 7 required variables here | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "aws" { | |
| region = "us-east-2" | |
| } | |
| data "aws_availability_zones" "azs" {} | |
| module "myapp-vpc" { | |
| source = "terraform-aws-modules/vpc/aws" | |
| version = "3.7.0" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module "eks" { | |
| source = "terraform-aws-modules/eks/aws" | |
| version = "17.20.0" | |
| cluster_name = "myapp-cluster" | |
| cluster_version = "1.17" | |
| subnets = module.myapp-vpc.private_subnets | |
| vpc_id = module.myapp-vpc.vpc_id | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module "eks" { | |
| source = "terraform-aws-modules/eks/aws" | |
| version = "17.20.0" | |
| cluster_name = "myapp-cluster" | |
| cluster_version = "1.17" | |
| subnets = module.myapp-vpc.private_subnets | |
| vpc_id = module.myapp-vpc.vpc_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "kubernetes" { | |
| host = data.aws_eks_cluster.myapp_cluster.endpoint | |
| token = data.aws_eks_cluster_auth.myapp_cluster.token | |
| cluster_ca_certificate = base64decode(data.aws_eks_cluster.myapp_cluster.certificate_authority.0.data) | |
| } | |
| data "aws_eks_cluster" "myapp_cluster" { | |
| name = module.eks.cluster_id | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: nginx-deployment | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: nginx | |
| replicas: 1 | |
| template: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl rand -base64 756 > key.txt |