Skip to content

Instantly share code, notes, and snippets.

View mvn-bachhuynh-dn's full-sized avatar

Bach Huynh V. VN.Danang mvn-bachhuynh-dn

View GitHub Profile
Description: >
Script to create a SSL certificate, S3 bucket and Cloudfront distribution.
###############################################################################
Parameters:
###############################################################################
DomainName:
Type: String
Description: The domain name.
#!/usr/bin/env python
#
# Simplistic RDS logfile downloader because AWS CLI + Botocore is broken. :-(
#
from __future__ import print_function
import argparse
import os.path
import sys
@mvn-bachhuynh-dn
mvn-bachhuynh-dn / bash_strict_mode.md
Created August 14, 2020 07:25 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u
@mvn-bachhuynh-dn
mvn-bachhuynh-dn / update-ecs-cluster-capacity-providers.sh
Created April 17, 2020 09:37 — forked from pahud/update-ecs-cluster-capacity-providers.sh
Update the capacity providers of your existing ECS clusters for Fargate
# 1. update your aws cli
# https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
#
# 2. update your existing cluster with capacity providers support
CLUSTER_NAME=fargate
SERVICE_NAME=myservice
FARGATE_WEIGHT=1
FARGATE_SPOT_WEIGHT=1
FARGATE_BASE=1
FARGATE_SPOT_BASE=0
@mvn-bachhuynh-dn
mvn-bachhuynh-dn / aws-cloudformation-deploy-watcher.sh
Created November 1, 2019 03:36 — forked from qoomon/aws-cloudformation-deploy-watcher.sh
Watch CloudFormation Events during `aws cloudformation deploy`
#!/usr/bin/env bash
set -e
function echo_help {
echo "usage: $0 [options]"
echo ""
echo "example: aws cloudformation deploy ... | $0 [options]"
echo ""
echo "options:"
echo " --stack-name"