This file contains 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
##################################################################### | |
# Runs on AWS Lambda | |
# Please make sure the role as the getParameters access. | |
# -> AmazonSSMFullAccess for simplicity | |
# | |
# Boto3 library is already included. | |
# Documentation: http://boto3.readthedocs.io/en/latest/reference/services/ssm.html#SSM.Client.describe_parameters | |
##################################################################### | |
import boto3 |
This file contains 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
# Google IdP for AWS Cognito | |
# IdP: Only google | |
# auth type: code | |
AWSTemplateFormatVersion: '2010-09-09' | |
Parameters: | |
GoogleClientId: | |
NoEcho: True | |
Type: String | |
GoogleClientSecret: |
This file contains 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
# coding: utf-8 | |
# Usage: python pre-sign.py -h | |
######################################## | |
import boto3 | |
import datetime | |
import sys, getopt | |
from botocore.client import Config | |
expiration = 93200 |
This file contains 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 | |
#chmod +x /usr/bin/awsgetparams | |
#Usage: awsgetparam <path> <profile name> <EMTPY|Y|y> | |
#Output: list of param value | |
PARAM_PATH="$1" | |
shift | |
PROFILE="$1" | |
shift |
This file contains 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 | |
#chmod +x /usr/bin/awsgetparam | |
#Usage: awsgetparam <param-name> <profile name> <EMTPY|Y|y> | |
#Output: param value | |
PARAM_NAME="$1" | |
shift | |
PROFILE="$1" | |
shift |
This file contains 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 | |
#chmod +x /usr/bin/awsecs | |
#Usage: awsecs <service-name> <profile name> | |
#Output: list of ec2 instance id | |
SERVICE="$1" | |
shift | |
PROFILE="$1" | |
shift |
This file contains 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
# Requirements | |
# - Docker | |
#-------- | |
# Installation | |
# - docker build -t <your image name> . | |
#-------- | |
# "root" folder is app | |
FROM python:3.6-alpine | |
RUN pip3 install -U awscli |
This file contains 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 | |
#chmod +x /usr/bin/awsec2 | |
#Usage: awsec2 <profile-name> | |
aws ec2 describe-instances --profile $1 | jq -r '.[][].Instances[] | [ .InstanceId, (.Tags[]|select(.Key=="Name")|.Value), (.NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress)] | select (.!=null) | @tsv' | column -s$'\t' -t' |
This file contains 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 | |
#chmod +x /usr/bin/awsssm | |
#Usage: awsssm <instance id> <profile name> | |
aws ssm start-session --target $1 --profile $2 |
This file contains 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 | |
#chmod +x /usr/bin/awsaccounts | |
#Usage: awsaccounts | |
aws organizations list-accounts --profile <profile name> | jq -r -e '["ID","", "NAME"], (.Accounts[] | [.Id, .Name] ) | @tsv' |
NewerOlder