Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

S3 Bucket Regional Namespaces with CDK

DEV Community·Sean Boult·20 days ago
#zR9bzDbK
#aws#cdk#devops#software#bucket#import
Reading 0:00
15s threshold

So you learned about the new S3 bucket account regional namespace feature and you're thinking "this is amazing, let me try in CDK." Well... This is where you'll learn that the L2 Bucket construct has not yet been updated to allow for this. Currently there are the following items which are tracking the long term fix. Issue aws/aws-cdk#37760 PR aws/aws-cdk#37386 You should give both of these a 👍 to help them get prioritized and shipped. Workaround Good news there is a workaround! By using the L1 construct as an escape hatch we can then pass in bucketNamePrefix and bucketNamespace . import * as cdk from ' aws-cdk-lib ' ; import { Construct } from ' constructs ' ; import * as s3 from ' aws-cdk-lib/aws-s3 ' ; export class Cdk101Stack extends cdk . Stack { constructor ( scope : Construct , id : string , props ?: cdk . StackProps ) { super ( scope , id , props ); // WORKAROUND: use the L1 bucket construct new s3 .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More