Skip to content

Instantly share code, notes, and snippets.

@shonansurvivors
shonansurvivors / terraform.sh
Last active September 28, 2023 21:51
A wrapper for executing Terraform commands with switchable backend and variables.
#!/bin/bash
set -euo pipefail
function usage() {
cat <<EOF
Usage: [TF_SKIP_INIT=boolean ] $0 [-help] <env> <command> [args]
env : environment [stg/prd/...]
command : terraform command [plan/apply/state/...]
args : subcommand [e.g. state "mv"] and terraform command options (see : terraform <command> -help)
TF_SKIP_INIT : skip "terraform init"
@shonansurvivors
shonansurvivors / etc-nginx-conf.d-default.conf
Last active September 19, 2021 12:58
nginx confs for rails-deploy
upstream app {
server unix:/home/webapp/rails-deploy/tmp/sockets/puma.sock;
}
server {
listen 80;
root /home/webapp/rails-deploy/public;
client_max_body_size 10m;
@shonansurvivors
shonansurvivors / rails_deploy_cfn.yml
Last active October 25, 2021 15:31
cloudformation for rails-deploy
AWSTemplateFormatVersion: 2010-09-09
Parameters:
VpcCidrBlock:
Type: String
Default: 172.18.0.0/16
PublicSubnetCidrBlockA:
Type: String
Default: 172.18.0.0/24
PublicSubnetCidrBlockC: