Skip to content

Instantly share code, notes, and snippets.

View allanchua101's full-sized avatar
👹
Coding and grinding

Allan Chua allanchua101

👹
Coding and grinding
View GitHub Profile
- 1 API Gateway
- 1 API Key
- 1 API Usage Plan
- 2 Lambda Functions
- 2 IAM Roles
- 1 Lambda Layer
- 4 Lambda Permissions (2 for CORS, 2 for GET)
{
"slackChannelName": "#place-your-channel-name",
"slackHookUrl": "https://place-your-hook-url-here"
}
@allanchua101
allanchua101 / wildcard-grant-permission.sh
Created August 22, 2020 13:45
Script for granting permission to all shell files inside the current directory
chmod +x *.sh
@allanchua101
allanchua101 / delete eksctl cluster.sh
Created February 28, 2020 15:02
Deleting an eksctl cluster
#!/bin/bash
# Sample assumes that random-cluster-1527688624
# is the name of your EKS cluster
eksctl delete cluster --name "random-cluster-1527688624" --wait
@allanchua101
allanchua101 / create eksctl cluster.sh
Created February 28, 2020 14:41
Minimal eks cluster creation
#!/bin/bash
eksctl create cluster
@allanchua101
allanchua101 / create cluster.sh
Created February 13, 2020 11:05
eksctl basic create
eksctl create cluster
@allanchua101
allanchua101 / Running API Gateways Containers.sh
Created September 22, 2018 03:04
Running your containers
docker run -d -p 52792:80 --name demo-auth-api demo/authentication-api
docker run -d -p 52791:80 --name demo-catalog-api demo/catalog-api
docker run -d -p 52790:80 --name demo-ledger-api demo/ledger-api
docker run -d -p 52793:80 --name demo-api-gateway demo/gateway-api
@allanchua101
allanchua101 / Containerize Services.sh
Created September 22, 2018 03:01
Containerizing the gateways.
docker build -t demo/authentication-api ./Authentication/
docker build -t demo/ledger-api ./Ledger/
docker build -t demo/catalog-api ./Catalog/
docker build -t demo/gateway-api ./Gateway/
@allanchua101
allanchua101 / Alpine-based containers.sh
Created September 21, 2018 15:00
50% reduction in size.
docker images demo/*
REPOSITORY TAG IMAGE ID CREATED SIZE
demo/gateway-api latest 977e83ddd61e 21 hours ago 131MB
demo/catalog-api latest b1f1c235b800 21 hours ago 127MB
demo/ledger-api latest 8d33e61eb1b8 21 hours ago 131MB
demo/authentication-api latest 16d274785949 21 hours ago 127MB
@allanchua101
allanchua101 / Dockerfile
Created September 21, 2018 14:57
Multistage Dockerfile using Alpine
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
# Pay attention to the following two lines