@@ -4,17 +4,20 @@ import * as s3sdk from "@aws-sdk/client-s3";
4
4
import * as aws from "@pulumi/aws" ;
5
5
import * as pulumi from "@pulumi/pulumi" ;
6
6
7
- const bucket = new aws . s3 . Bucket ( "tweet-bucket" , {
8
- serverSideEncryptionConfiguration : {
9
- rule : {
10
- applyServerSideEncryptionByDefault : {
11
- sseAlgorithm : "AES256" ,
12
- } ,
13
- } ,
14
- } ,
7
+ const bucket = new aws . s3 . BucketV2 ( "tweet-bucket" , {
15
8
forceDestroy : true , // We require this in the example as we are not managing the contents of the bucket via Pulumi
16
9
} ) ;
17
- export const bucketName = bucket . id ;
10
+
11
+ const myBucketSseConfig = new aws . s3 . BucketServerSideEncryptionConfigurationV2 ( "my-bucket-sse-config" , {
12
+ bucket : bucket . bucket ,
13
+ rules : [ {
14
+ applyServerSideEncryptionByDefault : {
15
+ sseAlgorithm : "AES256" ,
16
+ } ,
17
+ } ] ,
18
+ } ) ;
19
+
20
+ export const bucketName = bucket . bucket ;
18
21
19
22
const config = new pulumi . Config ( ) ;
20
23
const consumerKey = config . require ( "twitterConsumerKey" ) ;
@@ -83,7 +86,7 @@ const handler = eventRule.onEvent("on-timer-event", async() => {
83
86
84
87
// athena setup
85
88
const athena = new aws . athena . Database ( "tweets_database_1" ,
86
- { bucket : bucket . id , forceDestroy : true } ,
89
+ { bucket : bucket . bucket , forceDestroy : true } ,
87
90
) ;
88
91
89
92
// Sadly, there isn't support for Athena tables in Terraform.
0 commit comments