http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Snippet of code to be put on ~/.bash_profile to help SSH into instances via Session Manager while specifying AWS profiles | |
# It can be used by saving ~/.ssm_bash_profile and adding the following line to ~/.bash_profile | |
# source ~/.ssm_bash_profile | |
function aws-ssm-instance-list { | |
if [ "$#" -lt 1 ]; then | |
echo "Usage: aws-ssm-instance-list <profile name>" | |
else | |
output=$(aws ssm describe-instance-information --profile $1 --query "InstanceInformationList[*].{Name:ComputerName,Id:InstanceId,IPAddress:IPAddress}" --output text) | |
echo "$output" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_SELF="${0##*/}" | |
_HERE="$(dirname $(realpath ${0}))" | |
function aws_instance_profile_arn() { | |
curl -s http://169.254.169.254/2019-10-01/meta-data/iam/info | jq -r .InstanceProfileArn | |
} | |
function aws_instance_profile_name() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify | |
app = Flask(__name__) | |
health_status = True | |
@app.route('/toggle') | |
def toggle(): | |
global health_status | |
health_status = not health_status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2019/07/09 15:31:12 [INFO] Terraform version: 0.12.3 | |
2019/07/09 15:31:12 [INFO] Go runtime version: go1.12.4 | |
2019/07/09 15:31:12 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"} | |
2019/07/09 15:31:12 [DEBUG] Attempting to open CLI config file: /Users/cfalck/.terraformrc | |
2019/07/09 15:31:12 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2019/07/09 15:31:12 [INFO] CLI command args: []string{"plan"} | |
2019/07/09 15:31:12 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config | |
2019/07/09 15:31:12 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory | |
2019/07/09 15:31:12 [DEBUG] New state was assigned lineage "a9bfd18e-bfa6-856d-64b4-3f65a428def2" | |
2019/07/09 15:31:12 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to site.pp to create a default bin path for all exec statements | |
# Default Exec binary paths | |
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] } |