Skip to content

Commit 0114a73

Browse files
authored
Update aws-ts-twitter-athena to BucketV2 (#1700)
Re: pulumi/home#3631
1 parent 4ec4a7a commit 0114a73

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

aws-ts-twitter-athena/index.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ import * as s3sdk from "@aws-sdk/client-s3";
44
import * as aws from "@pulumi/aws";
55
import * as pulumi from "@pulumi/pulumi";
66

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", {
158
forceDestroy: true, // We require this in the example as we are not managing the contents of the bucket via Pulumi
169
});
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;
1821

1922
const config = new pulumi.Config();
2023
const consumerKey = config.require("twitterConsumerKey");
@@ -83,7 +86,7 @@ const handler = eventRule.onEvent("on-timer-event", async() => {
8386

8487
// athena setup
8588
const athena = new aws.athena.Database("tweets_database_1",
86-
{ bucket: bucket.id, forceDestroy: true },
89+
{ bucket: bucket.bucket, forceDestroy: true },
8790
);
8891

8992
// Sadly, there isn't support for Athena tables in Terraform.

0 commit comments

Comments
 (0)