question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

S3 BucketEncryption Property

See original GitHub issue

Does anyone know how to properly set the variable BucketEncryption for the S3 resource?

Currently I have:

from troposphere import Output, Ref, Join, GetAtt
from troposphere.s3 import Bucket, BucketEncryption, ServerSideEncryptionRule, ServerSideEncryptionByDefault

import troposphere

t = troposphere.Template()

t.add_description("default description")

s3loggingbucket = t.add_resource(
    troposphere.s3.Bucket(
        "01loggingbucket",
        BucketEncryption = "AES256",
    ))

print(t.to_json())

I get the error message TypeError: <class 'troposphere.s3.Bucket'>: 01loggingbucket.BucketEncryption is <type 'str'>, expected <class 'troposphere.s3.BucketEncryption'>

Does anyone know what the proper value is for BucketEncryption?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
danehrlich1commented, Apr 17, 2018

With a usable variable for SSEAlgorithm put in and KMSMasterKeyID deleted. So this does “SSE-S3” style encryption where the keys are stored in S3.

t.add_resource(s3.Bucket(
    'MyBucket',
    BucketEncryption=s3.BucketEncryption(
        ServerSideEncryptionConfiguration=[
            s3.ServerSideEncryptionRule(
                ServerSideEncryptionByDefault=s3.ServerSideEncryptionByDefault(
                    SSEAlgorithm='AES256'
                )
            )
        ]
    ),
))
0reactions
trainguyenxcommented, May 30, 2019

Thank you guys.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::S3::Bucket BucketEncryption - AWS CloudFormation
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.
Read more >
AWS::S3::Bucket BucketEncryption - Amazon CloudFormation
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or Amazon KMS-managed keys (SSE-KMS) bucket.
Read more >
How do you set SSE-S3 or SSE-KMS encryption on S3 ...
Use the BucketEncryption property to specify default encryption for a bucket using server-side encryption with Amazon S3-managed keys SSE-S3 ...
Read more >
aws-cloudformation-user-guide/aws-properties-s3-bucket ...
AWS ::S3::Bucket BucketEncryption. Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS ...
Read more >
Setting up secure AWS S3 buckets with CloudFormation
S3 bucket properties for SSE-KMS encryption using the default account KMS key: BucketEncryption: ServerSideEncryptionConfiguration: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found