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 | |
| from botocore.exceptions import ClientError | |
| from datetime import datetime, timedelta | |
| import time | |
| import os | |
| # region = "eu-central-1" | |
| region = "ap-southeast-1" | |
| # Create custom sessions |
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 sys | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| from datetime import datetime, timedelta | |
| import time | |
| import pytz | |
| profile = "profile name" | |
| region = "us-west-2" | |
| dry_run = True |
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
| echo -e "protocol=https\npath=/v1/repos/myrepo\nhost=git-codecommit.us-east-1.amazonaws.com" | aws codecommit credential-helper get --debug | |
| echo -e "protocol=https\npath=/v1/repos/myrepo\nhost=git-codecommit.us-east-1.amazonaws.com" | aws codecommit --profile [profile] credential-helper get --debug |
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
| Highlight `xxxx` then `Command+Control+G` to quick select all | |
| Command+Alt/Option+N then `i 1 1 each=5` | |
| i initial step each=repeat how many times | |
| topic { | |
| id = "${var.jde_s3_prod_bucket_1_notifications_xxxx[1]}" | |
| events = ["${var.jde_s3_prod_bucket_1_notifications_xxxx[2]}"] | |
| filter_prefix = "${var.jde_s3_prod_bucket_1_notifications_xxxx[3]}" | |
| filter_suffix = "${var.jde_s3_prod_bucket_1_notifications_xxxx[4]}" |
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
| # Pull the s3 bucket notifications and generate the following: | |
| # 1. Terraform resource configuration | |
| # 2. Variable definitions | |
| # 3. TFVars lists | |
| import boto3 | |
| profile = "my_profile" | |
| region = "us-east-1" |
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 | |
| profile = "my_profile" | |
| region = "us-west-2" | |
| session = boto3.session.Session(profile_name=profile, region_name=region) | |
| iam = session.resource("iam") | |
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
| SELECT | |
| eventtime, | |
| CASE | |
| when useridentity.type = 'IAMUser' then useridentity.username | |
| when useridentity.type = 'Root' then useridentity.invokedby | |
| when useridentity.type = 'AssumedRole' then useridentity.arn | |
| ELSE | |
| 'undefined' | |
| END as "userid", | |
| sourceipaddress, |
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
| Select | |
| eventtime, | |
| CASE | |
| when useridentity.type = 'IAMUser' then useridentity.username | |
| when useridentity.type = 'Root' then useridentity.invokedby | |
| when useridentity.type = 'AssumedRole' then useridentity.arn | |
| ELSE | |
| 'undefined' | |
| END as "userid", | |
| sourceipaddress, |
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
| acm.amazonaws.com | |
| apigateway.amazonaws.com | |
| athena.amazonaws.com | |
| autoscaling.amazonaws.com | |
| clouddirectory.amazonaws.com | |
| cloudformation.amazonaws.com | |
| cloudfront.amazonaws.com | |
| cloudsearch.amazonaws.com | |
| cloudtrail.amazonaws.com | |
| codecommit.amazonaws.com |
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 sys | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| from datetime import datetime, timedelta | |
| import time | |
| import pytz | |
| profile = "my_profile" | |
| region = "us-west-2" | |
| dry_run = True |