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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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: "aws:kms",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be 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