From 252431ac90d22972fbefc25c94b46dd51bebdab4 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Thu, 19 Sep 2024 11:48:41 -0400 Subject: [PATCH] Update aws-ts-serverless-datawarehouse to BucketV2 --- .../datawarehouse/index.ts | 12 ++++++------ .../datawarehouse/inputStream/index.ts | 6 +++--- .../datawarehouse/partitionRegistrar/index.ts | 4 ++-- aws-ts-serverless-datawarehouse/index.ts | 2 +- aws-ts-serverless-datawarehouse/utils/index.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/aws-ts-serverless-datawarehouse/datawarehouse/index.ts b/aws-ts-serverless-datawarehouse/datawarehouse/index.ts index 203eadfa7..740a29f92 100644 --- a/aws-ts-serverless-datawarehouse/datawarehouse/index.ts +++ b/aws-ts-serverless-datawarehouse/datawarehouse/index.ts @@ -3,7 +3,7 @@ import * as aws from "@pulumi/aws"; import { ARN } from "@pulumi/aws"; import { EventRuleEvent } from "@pulumi/aws/cloudwatch"; -import { BucketArgs } from "@pulumi/aws/s3"; +import { BucketV2Args } from "@pulumi/aws/s3"; import { input } from "@pulumi/aws/types"; import * as pulumi from "@pulumi/pulumi"; import { getS3Location } from "../utils"; @@ -13,8 +13,8 @@ import { HourlyPartitionRegistrar, PartitionRegistrarArgs } from "./partitionReg export class ServerlessDataWarehouse extends pulumi.ComponentResource { - public dataWarehouseBucket: aws.s3.Bucket; - public queryResultsBucket: aws.s3.Bucket; + public dataWarehouseBucket: aws.s3.BucketV2; + public queryResultsBucket: aws.s3.BucketV2; public database: aws.glue.CatalogDatabase; private tables: { [key: string]: aws.glue.CatalogTable } = {}; private inputStreams: { [key: string]: aws.kinesis.Stream } = {}; @@ -22,10 +22,10 @@ export class ServerlessDataWarehouse extends pulumi.ComponentResource { constructor(name: string, args: DataWarehouseArgs = {}, opts: pulumi.ComponentResourceOptions = {}) { super("serverless:data_warehouse", name, opts); - const bucketArgs: BucketArgs | undefined = args.isDev ? { forceDestroy: true } : undefined; + const bucketArgs: BucketV2Args | undefined = args.isDev ? { forceDestroy: true } : undefined; - const dataWarehouseBucket = new aws.s3.Bucket("datawarehouse-bucket", bucketArgs, { parent: this }); - const queryResultsBucket = new aws.s3.Bucket("query-results-bucket", bucketArgs, { parent: this }); + const dataWarehouseBucket = new aws.s3.BucketV2("datawarehouse-bucket", bucketArgs, { parent: this }); + const queryResultsBucket = new aws.s3.BucketV2("query-results-bucket", bucketArgs, { parent: this }); const database = args.database || new aws.glue.CatalogDatabase(name, { name, diff --git a/aws-ts-serverless-datawarehouse/datawarehouse/inputStream/index.ts b/aws-ts-serverless-datawarehouse/datawarehouse/inputStream/index.ts index f79c93379..468a53277 100644 --- a/aws-ts-serverless-datawarehouse/datawarehouse/inputStream/index.ts +++ b/aws-ts-serverless-datawarehouse/datawarehouse/inputStream/index.ts @@ -94,8 +94,8 @@ export class InputStream extends pulumi.ComponentResource { }, bucketArn: args.destinationBucket.arn, prefix: args.tableName + "/", - bufferInterval, - bufferSize: 64, + bufferingInterval: bufferInterval, + bufferingSize: 64, roleArn: role.arn, dataFormatConversionConfiguration: { inputFormatConfiguration: { @@ -129,7 +129,7 @@ export class InputStream extends pulumi.ComponentResource { export interface InputStreamArgs { databaseName: pulumi.Input; tableName: pulumi.Input; - destinationBucket: aws.s3.Bucket; + destinationBucket: aws.s3.BucketV2; shardCount: number; fileFlushIntervalSeconds?: number; } diff --git a/aws-ts-serverless-datawarehouse/datawarehouse/partitionRegistrar/index.ts b/aws-ts-serverless-datawarehouse/datawarehouse/partitionRegistrar/index.ts index da79c8452..83d7edde2 100644 --- a/aws-ts-serverless-datawarehouse/datawarehouse/partitionRegistrar/index.ts +++ b/aws-ts-serverless-datawarehouse/datawarehouse/partitionRegistrar/index.ts @@ -57,8 +57,8 @@ export class HourlyPartitionRegistrar extends pulumi.ComponentResource { export interface PartitionRegistrarArgs { table: string; partitionKey: string; - dataWarehouseBucket: aws.s3.Bucket; - athenaResultsBucket: aws.s3.Bucket; + dataWarehouseBucket: aws.s3.BucketV2; + athenaResultsBucket: aws.s3.BucketV2; database: aws.glue.CatalogDatabase; region: string; scheduleExpression?: string; diff --git a/aws-ts-serverless-datawarehouse/index.ts b/aws-ts-serverless-datawarehouse/index.ts index 589d560ba..ad127e0ee 100644 --- a/aws-ts-serverless-datawarehouse/index.ts +++ b/aws-ts-serverless-datawarehouse/index.ts @@ -155,7 +155,7 @@ dataWarehouse.withTable("facts", factTableArgs); const data = `{"thing": "sky", "color": "blue"}\n{ "thing": "seattle sky", "color": "grey"}\n{ "thing": "oranges", "color": "orange"}`; const factJSON = new aws.s3.BucketObject("factsFile", { - bucket: dataWarehouse.dataWarehouseBucket, + bucket: dataWarehouse.dataWarehouseBucket.bucket, content: data, key: `${factTableName}/facts.json`, }); diff --git a/aws-ts-serverless-datawarehouse/utils/index.ts b/aws-ts-serverless-datawarehouse/utils/index.ts index 73f81ee19..ecc2d6eb1 100644 --- a/aws-ts-serverless-datawarehouse/utils/index.ts +++ b/aws-ts-serverless-datawarehouse/utils/index.ts @@ -3,6 +3,6 @@ import * as aws from "@pulumi/aws"; import * as pulumi from "@pulumi/pulumi"; -export const getS3Location = (bucket: aws.s3.Bucket, tableName: string): pulumi.Output => { +export const getS3Location = (bucket: aws.s3.BucketV2, tableName: string): pulumi.Output => { return bucket.arn.apply(a => `s3://${a.split(":::")[1]}/${tableName}`); };