http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
| print("UPDATE AUG 2023: this script is beyond old and broken") | |
| print("You may find interesting and more up to date resources in the comments of the gist") | |
| exit() | |
| from slacker import Slacker | |
| import json | |
| import argparse | |
| import os | |
| # This script finds all channels, private channels and direct messages |
| { | |
| "APIGatewayServiceRolePolicy": { | |
| "Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy", | |
| "AttachmentCount": 0, | |
| "CreateDate": "2019-10-22T18:22:01+00:00", | |
| "DefaultVersionId": "v6", | |
| "Document": { | |
| "Statement": [ | |
| { |
This gist contains lists of modules available in
in AWS Lambda.
| import boto3 | |
| import logging | |
| #setup simple logging for INFO | |
| logger = logging.getLogger() | |
| logger.setLevel(logging.INFO) | |
| #define the connection | |
| ec2 = boto3.resource('ec2') |
AWS에서 docker를 쓸 때 high traffic server라면 이렇게 하는 것이 좋겠다. amazon linux를 쓴다고 하자.
ulimit를 올려주어야 한다. /etc/security/limit.conf 에서 고쳐주어도 docker에는 적용되지 않는다.
limit.conf는 PAM을 통해서 로그인했을 때만 먹는 설정이라 그렇다.
docker로 띄운 process의 pid를 찾고 cat /proc/<pid>/limits를 실행해서 보면 적용되었는지 아닌지 확실하게 알 수 있다.
kernel에서 직접 그 프로세스에 어떤 ulimit이 적용되었는지 확인하는 방법이다.
그래서 /etc/sysconfig/docker 파일을 만들고 아래를 추가한다.
I've been playing with jq, and I've been having a hard time finding examples of how it works with output from a service like AWS (which I use a lot).
Here is one I use a lot with vagrant-ec2.
When we're launching and killing a lot of instances, the AWS API is the only way to track down which instances are live, ready, dead, etc.
To find instances that are tagged with e.g. {"Key" = "Name", "Value" = "Web-00'} in the middle of a vagrant dev cycle, or a prod launch/replace cycle, you can do something like this:
| #!/bin/bash -eo pipefail | |
| ## Allows for creation of "Basic" DNS records in a Route53 hosted zone | |
| function main() { | |
| record_name=$1 | |
| record_value=$2 | |
| [[ -z $record_name ]] && echo "record_name is: $record_name" && exit 1 | |
| [[ -z $record_value ]] && echo "record_value is: $record_value" && exit 1 |