Skip to content

Instantly share code, notes, and snippets.

View Th0masStorm's full-sized avatar

Karen Tovmasyan Th0masStorm

View GitHub Profile
@Th0masStorm
Th0masStorm / main.go
Created January 29, 2022 19:21
Dummy AZ printer
package main
import (
"bufio"
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, req *http.Request) {
// Request AWS metadata for Availability zone
@Th0masStorm
Th0masStorm / dax.yaml
Last active January 8, 2021 14:54
DAX cluster creation with CloudFormation
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
TableName:
Type: String
ClusterSize:
Type: Number
Subnets:
Type: List<AWS::EC2::Subnet::Id>
AWSTemplateFormatVersion: "2010-09-09"
Resources:
Pool:
Type: AWS::Cognito::UserPool
PoolClient:
Type: "AWS::Cognito::UserPoolClient"
Properties:
UserPoolId: !Ref Pool
ExplicitAuthFlows:
- ALLOW_USER_PASSWORD_AUTH
aws ecs register-task-definition --profile YOUR_PROFILE \
--region YOUR_REGION \
--cli-input-json file://taskDefinition.json
aws ecs create-service --profile YOUR_PROFILE \
--region YOUR_REGION \
--cluster mycluster \
--launch-type FARGATE \
--task-definition YOUR_TASK_DEF \
--desired-count 1 \
--platform-version LATEST \
@Th0masStorm
Th0masStorm / fargate.sh
Last active June 7, 2019 07:33
Building image, pushing to ECR and deploying as Fargate service
cd FlaskApp
# That's some hell of bash pipelining, but I'm too lazy to copy/paste ECR uri.
REPO=$(aws ecr describe-repositories --profile YOUR_PROFILE \
--region YOUR_REGION \
--repository-names YOUR_REPO_NAME | \
jq .repositories[].repositoryUri | \
sed -e 's/^"//' -e 's/"$//')
docker build -t ${REPO}:v1 .
$(aws ecr get-login --no-include-email --region YOUR_REGION --profile YOUR_PROFILE)