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 argparse | |
| import boto3 | |
| import datetime | |
| from dateutil.tz import tzutc | |
| def is_in_autoscale_group(region, instance_id): | |
| asg = boto3.client('autoscaling', region_name=region) | |
| instances = \ | |
| asg.describe_auto_scaling_instances(InstanceIds=[instance_id]) |
This file has been truncated, but you can view the full file.
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
| { | |
| "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 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 python3 | |
| # | |
| # Query AWS Athena using SQL | |
| # Copyright (c) Alexey Baikov <sysboss[at]mail.ru> | |
| # | |
| # This snippet is a basic example to query Athen and load the results | |
| # to a variable. | |
| # | |
| # Requirements: | |
| # > pip3 install boto3 botocore retrying |
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
| """ | |
| Code adapted from and inspired by http://blog.ranman.org/cleaning-up-aws-with-boto3/. | |
| """ | |
| import os | |
| import re | |
| from datetime import datetime, timedelta | |
| import boto3 |