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
| aws_access_key = "<REPLACE_WTIH_YOUR_ACCESS_KEY>" | |
| aws_secret_key = "<REPLACE_WTIH_YOUR_SECRET_KEY>" | |
| region = "us-west-2" | |
| availability_zones_count = 2 | |
| project = "TFEKSWorkshop" | |
| vpc_cidr = "10.0.0.0/16" | |
| subnet_cidr_bits = 8 |
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 "aws_access_key" { | |
| description = "AWS access key" | |
| type = string | |
| } | |
| variable "aws_secret_key" { | |
| description = "AWS secret key" | |
| type = string | |
| } |
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
| # EKS Node Groups | |
| resource "aws_eks_node_group" "this" { | |
| cluster_name = aws_eks_cluster.this.name | |
| node_group_name = var.project | |
| node_role_arn = aws_iam_role.node.arn | |
| subnet_ids = aws_subnet.private[*].id | |
| scaling_config { | |
| desired_size = 2 | |
| max_size = 5 |
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
| # EKS Cluster | |
| resource "aws_eks_cluster" "this" { | |
| name = "${var.project}-cluster" | |
| role_arn = aws_iam_role.cluster.arn | |
| version = "1.21" | |
| vpc_config { | |
| # security_group_ids = [aws_security_group.eks_cluster.id, aws_security_group.eks_nodes.id] | |
| subnet_ids = flatten([aws_subnet.public[*].id, aws_subnet.private[*].id]) | |
| endpoint_private_access = true |
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
| data "aws_availability_zones" "available" { | |
| state = "available" | |
| } |
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
| terraform { | |
| backend "s3" { | |
| bucket = "<REPLACE_WITH_YOUR_REMOTESTATE_BUCKETNAME>" | |
| dynamodb_table = "<REPLACE_WITH_YOUR_DYNAMODB_TABLENAME>" | |
| key = "terraform-aws-eks-workshop.tfstate" | |
| region = "us-west-1" | |
| encrypt = true | |
| } | |
| } |
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
| # VPC | |
| resource "aws_vpc" "this" { | |
| cidr_block = var.vpc_cidr | |
| enable_dns_hostnames = true | |
| enable_dns_support = true | |
| tags = { | |
| Name = "${var.project}-vpc", | |
| "kubernetes.io/cluster/${var.project}-cluster" = "shared" |
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
| terraform { | |
| required_version = ">= 1.1.0" | |
| required_providers { | |
| aws = { | |
| source = "hashicorp/aws" | |
| version = "~> 4.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
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| ... | |
| services.AddHealthChecks(); | |
| ... | |
| } | |
| public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
| { | |
| ... |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <system.webServer> | |
| <handlers> | |
| <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/> | |
| </handlers> | |
| <aspNetCore requestTimeout="00:20:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/> | |
| </system.webServer> | |
| </configuration> |