Skip to content

Instantly share code, notes, and snippets.

View a-patel's full-sized avatar
👨‍💻
while (!sleep) { learn(); }

Ashish Patel a-patel

👨‍💻
while (!sleep) { learn(); }
View GitHub Profile
@a-patel
a-patel / terraform.tfvars
Last active June 7, 2022 11:39
Amazon EKS Terraform Workshop: Terraform TFVars
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
@a-patel
a-patel / variables.tf
Last active June 7, 2022 11:39
Amazon EKS Terraform Workshop: Variables
variable "aws_access_key" {
description = "AWS access key"
type = string
}
variable "aws_secret_key" {
description = "AWS secret key"
type = string
}
@a-patel
a-patel / worker-nodes.tf
Last active June 7, 2022 11:39
Amazon EKS Terraform Workshop: Worker Nodes
# 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
@a-patel
a-patel / eks-cluster.tf
Last active June 7, 2022 11:39
Amazon EKS Terraform Workshop: EKS Cluster.
# 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
@a-patel
a-patel / data-sources.tf
Last active June 7, 2022 11:40
Amazon EKS Terraform Workshop: Data Sources
data "aws_availability_zones" "available" {
state = "available"
}
@a-patel
a-patel / backend.tf
Created February 25, 2022 20:46
Amazon EKS Terraform Workshop: Backend (Remote State)
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
}
}
@a-patel
a-patel / vpc.tf
Last active June 7, 2022 11:42
Amazon EKS Terraform Workshop: VPC
# 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"
@a-patel
a-patel / providers.tf
Created February 25, 2022 20:41
Amazon EKS Terraform Workshop: Providers
terraform {
required_version = ">= 1.1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
@a-patel
a-patel / Startup.cs
Created November 3, 2021 13:18
Health Checks in ASP.NET and ASP.NET Core
public void ConfigureServices(IServiceCollection services)
{
...
services.AddHealthChecks();
...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
@a-patel
a-patel / web.config
Created November 3, 2021 13:01
Increase the timeout of .NET/.NET Core Applications
<?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>