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 kubernetes-ts-s3-rollout to BucketV2 #1701

Merged
merged 1 commit 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
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
Loading