Twitter: @prog893
Instagram: @yakuzavisuals
- 2014年4月 - 2018年4月 静岡大学 情報学部 情報科学科
| module "hoge" { | |
| source = "git+ssh://git@github.com/baikonur-oss/terraform-aws-iam-nofile?ref=v1.0.2" | |
| ... | |
| } |
Twitter: @prog893
Instagram: @yakuzavisuals
| #!/bin/bash | |
| set -euox pipefail | |
| IFS=$'\n\t' | |
| # https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-log-user-data | |
| exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
| # Detect OS | |
| if [ -e "/etc/os-release" ]; then |
| #!/usr/local/bin/python3 | |
| import json | |
| import argparse | |
| import re | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser(description='Filter tfstate resources by resource path') | |
| parser.add_argument('tfstate', type=str, help="tfstate file to parse") |
For signed cookies, refer here
from cloudfront_signed_url import generate_cloudfront_signed_url
generate_cloudfront_signed_url("https://your-cf-domain.com/path/to/file.txt", 3600)| function pullreq { | |
| CURRENT_BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2) | |
| REPO_ORIGIN=$(git remote get-url --push origin) | |
| GHE_URL="your-github-enterprise.com" | |
| if [[ ${CURRENT_BRANCH_NAME} == "master" ]] ; | |
| then | |
| echo "You are on master branch! Doing nothing" | |
| return | |
| fi |
| #!/bin/bash | |
| # all regions (2019/07/17) | |
| regions=("ap-northeast-1" "ap-northeast-2" "ap-northeast-3" "ap-south-1" "ap-southeast-1" "ap-southeast-2" "ca-central-1" "eu-central-1" "eu-north-1" "eu-west-1" "eu-west-2" "eu-west-3" "sa-east-1" "us-east-1" "us-east-2" "us-west-1" "us-west-2") | |
| for region in "${regions[@]}" | |
| do | |
| echo "Lambda runtimes used in region ${region}" | |
| aws lambda list-functions --region ${region} | jq '.Functions[].Runtime' | sort | uniq | |
| done |
For those times when you try to delete a versioned S3 bucket on AWS that has millions of objects/versions in it. (Should also work on non-versioned buckets as well)
The following options are available:
~/.aws/config to use when sending requests to AWS API (e.g. foo for [profile foo] in ~/.aws/config file). Default is default.Protect container instance with containers running from scale-in. Uses aws-cli set-instance-protection. Inspired by: https://stackoverflow.com/questions/45020323/ecs-asg-scaling-down-policy-recommendations
Ignores ecs-agent and dd-agent when counting running containers. You can add more in containers_running in the script below.
For signed URLs, refer here
from cloudfront_signed_url import generate_cloudfront_signed_url
url = "https://your-cf-domain.com/path/to/file.txt"
cookie = generate_cloudfront_signed_cookie(url, 3600)