Six phase of DM
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
import boto3 | |
# This example uses the CloudFormation product | |
client = boto3.client('cloudformation') | |
# and is listing all of the deployed CloudFormation stacks | |
paginator = client.get_paginator('list_stacks') | |
collector = [] | |
# "StackSummaries" is the name of the key AWS returns for the "list_stacks" call. | |
# This will differ for every paginated AWS call | |
result = list(map(collector.extend, [x['StackSummaries'] for x in paginator.paginate()])) |
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
#!/usr/bin/env ansible-playbook -c local | |
# | |
# AWS STS token update playbook. | |
# | |
# Updating AWS session tokens with STS can be a pain. But MFA is good. So let's | |
# automate the management of the .aws/credentials file to make it not painful! | |
# | |
# Usage: | |
# | |
# 1. Save this to a file like /usr/local/bin/aws-sts-token |
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 | |
set -e | |
set -u | |
clear | |
ami="ami-10e00b6d" | |
size="t2.medium" | |
today=$(date +"%m-%d-%y-%H%M") | |
localip=$(curl -s https://ipinfo.io/ip) |
Command
aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'if [[ $(aws s3api get-bucket-acl --bucket {} --query '"'"'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` && Permission==`READ`]'"'"' --output text) ]]; then aws s3api put-bucket-acl --acl "private" --bucket {} ; fi'
1. List all of the user's buckets, and output the name, as text.
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 | |
export AWS_PROFILE='default' | |
mkdir -p iam/policies | |
POLICIES=$(aws iam list-policies --scope Local --query "Policies[*].{name: PolicyName, version: DefaultVersionId, arn: Arn}") | |
echo $POLICIES | jq -c '.[]' | \ | |
while read policy; do |
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
a4b.amazonaws.com | |
access-analyzer.amazonaws.com | |
account.amazonaws.com | |
acm-pca.amazonaws.com | |
acm.amazonaws.com | |
airflow-env.amazonaws.com | |
airflow.amazonaws.com | |
alexa-appkit.amazon.com | |
alexa-connectedhome.amazon.com | |
amazonmq.amazonaws.com |
In your command-line run the following commands:
brew doctor
brew update
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
{ | |
"AttributeDefinitions": [ | |
{ | |
"AttributeName": "Deleted", | |
"AttributeType": "S" | |
}, | |
{ | |
"AttributeName": "Id", | |
"AttributeType": "S" | |
} |