Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aws-ts-twitter-athena to BucketV2 #1700

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions aws-ts-twitter-athena/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ import * as s3sdk from "@aws-sdk/client-s3";
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";

const bucket = new aws.s3.Bucket("tweet-bucket", {
serverSideEncryptionConfiguration: {
rule: {
applyServerSideEncryptionByDefault: {
sseAlgorithm: "AES256",
},
},
},
const bucket = new aws.s3.BucketV2("tweet-bucket", {
forceDestroy: true, // We require this in the example as we are not managing the contents of the bucket via Pulumi
});
export const bucketName = bucket.id;

const myBucketSseConfig = new aws.s3.BucketServerSideEncryptionConfigurationV2("my-bucket-sse-config", {
bucket: bucket.bucket,
rules: [{
applyServerSideEncryptionByDefault: {
sseAlgorithm: "AES256",
},
}],
});

export const bucketName = bucket.bucket;

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

// athena setup
const athena = new aws.athena.Database("tweets_database_1",
{ bucket: bucket.id, forceDestroy: true },
{ bucket: bucket.bucket, forceDestroy: true },
);

// Sadly, there isn't support for Athena tables in Terraform.
Expand Down
Loading