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 boto3 | |
from botocore.exceptions import NoCredentialsError, PartialCredentialsError | |
from botocore.config import Config | |
import pprint | |
config = Config( | |
region_name = region, | |
retries = { | |
'max_attempts': 10, | |
'mode': 'standard' |
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
from botocore.config import Config | |
region='eu-west-1' | |
config = Config( | |
region_name = region, | |
retries = { | |
'max_attempts': 10, | |
'mode': 'standard' | |
} |
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 time | |
def get_ttl(days: int) -> int: | |
seconds_since_epoch=int(str(time.time()).split('.')[0]) | |
seconds_in_n_days=days * 86400 | |
time_to_live=seconds_since_epoch + seconds_in_n_days | |
return time_to_live |