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
import json | |
import boto3 | |
import email | |
import os | |
from datetime import datetime | |
import re | |
def get_timestamp(): | |
current = datetime.now() | |
return(str(current.year) + '-' + str(current.month) + '-' + str(current.day) + '-' + str(current.hour) + '-' + str(current.minute) + '-' + str(current.second)) |
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
{ | |
2 "Version": "2012-10-17", | |
3 "Statement": [ | |
4 { | |
5 "Sid": "GetSourceBucketConfiguration", | |
6 "Effect": "Allow", | |
7 "Action": [ | |
8 "s3:ListBucket", | |
9 "s3:GetBucketLocation", | |
10 "s3:GetBucketAcl", |
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
{ | |
2 "Version": "2012-10-17", | |
3 "Id": "PolicyForDestinationBucket", | |
4 "Statement": [ | |
5 { | |
6 "Sid": "Permissions on objects and buckets", | |
7 "Effect": "Allow", | |
8 "Principal": { | |
9 "AWS": "arn:aws:iam::999999999999:role/cross-account-bucket-replication-role" | |
10 }, |
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
{ | |
2 "Version": "2012-10-17", | |
3 "Id": "PolicyForDestinationBucket", | |
4 "Statement": [ | |
5 { | |
6 "Sid": "Permissions on objects and buckets", | |
7 "Effect": "Allow", | |
8 "Principal": { | |
9 "AWS": "arn:aws:iam::999999999999:role/cross-account-bucket-replication-role" | |
10 }, |