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 __future__ import absolute_import, print_function, unicode_literals | |
import boto3 | |
def clean_old_lambda_versions(): | |
client = boto3.client('lambda') | |
functions = client.list_functions()['Functions'] | |
for function in functions: | |
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions'] | |
for version in versions: |
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
# Export as Text Table | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt | |
# Export as JSON | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json | |
# Export User Pool with more than 60 users (pagination) | |
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json |