Skip to content

Commit

Permalink
Update kubernetes-ts-s3-rollout to BucketV2
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Sep 19, 2024
1 parent f143bd3 commit d630e6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kubernetes-ts-s3-rollout/s3Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import * as pulumi from "@pulumi/pulumi";

export interface FileBucketOpts {
files: string[];
policy?: (bucket: aws.s3.Bucket) => pulumi.Output<string>;
policy?: (bucket: aws.s3.BucketV2) => pulumi.Output<string>;
}

export class FileBucket {
public readonly bucket: aws.s3.Bucket;
public readonly bucket: aws.s3.BucketV2;
public readonly files: { [key: string]: aws.s3.BucketObject };
public readonly policy: aws.s3.BucketPolicy;

private readonly fileContents: { [key: string]: string };

constructor(bucketName: string, opts: FileBucketOpts) {
this.bucket = new aws.s3.Bucket(bucketName);
this.bucket = new aws.s3.BucketV2(bucketName);
this.fileContents = {};
this.files = {};
for (const file of opts.files) {
this.fileContents[file] = fs.readFileSync(file).toString();
this.files[file] = new aws.s3.BucketObject(file, {
bucket: this.bucket,
bucket: this.bucket.bucket,
source: new pulumi.asset.FileAsset(file),
contentType: mime.getType(file) || undefined,
});
Expand Down

0 comments on commit d630e6b

Please sign in to comment.