Skip to content

Instantly share code, notes, and snippets.

@erickascic

erickascic/bucket_test.py

Last active Mar 24, 2020
Embed
What would you like to do?
import potemkin
import boto3
@potemkin.CloudFormationStack(
'aes256_bucket.yml',
stack_name_stem='TestStack',
parameters={'BucketName': 'unclefreddie33388'},
aws_profile='myprofile'
)
def test_bucket_has_aes256_encryption(stack_outputs, stack_name):
full_bucket_name = stack_outputs['BucketNameOut']
s3 = boto3.Session(profile='myprofile').client('s3')
get_bucket_encryption_response = s3.get_bucket_encryption(
Bucket=full_bucket_name
)
assert get_bucket_encryption_response['ServerSideEncryptionConfiguration']['Rules'][0]['ApplyServerSideEncryptionByDefault']['SSEAlgorithm'] == 'AES256'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.