gorgeous-lunch-7514
09/08/2023, 1:16 PMconst adminBucketDir = `${__dirname}/../build/`;
const updatedFiles: BucketObject[] = [];
crawlDirectory(adminBucketDir, (filePath: string) => {
const relativeFilePath = filePath.replace(adminBucketDir + "/", "");
console.log(relativeFilePath, filePath);
const contentFile = new aws.s3.BucketObject(
relativeFilePath,
{
key: relativeFilePath,
acl: "public-read",
bucket: config.adminBucket,
contentType: mime.getType(filePath) || undefined,
source: new pulumi.asset.FileAsset(filePath),
}
);
updatedFiles.push(contentFile);
});
billowy-army-68599
config.adminBucket
set to?gorgeous-lunch-7514
09/08/2023, 1:27 PMbillowy-army-68599
gorgeous-lunch-7514
09/08/2023, 1:50 PMpulumi:pulumi:Stack (admin-dev):
OutputImpl {
__pulumiOutput: true,
resources: [Function (anonymous)],
allResources: [Function (anonymous)],
isKnown: Promise { <pending> },
isSecret: Promise { <pending> },
promise: [Function (anonymous)],
toString: [Function (anonymous)],
toJSON: [Function (anonymous)]
}
billowy-army-68599
gorgeous-lunch-7514
09/08/2023, 1:53 PMconst updatedFiles: BucketObject[] = [];
config.adminBucket.apply(bucket => {
const adminBucketDir = `${__dirname}/../build/`;
crawlDirectory(adminBucketDir, (filePath: string) => {
const relativeFilePath = filePath.replace(adminBucketDir + "/", "");
console.log(relativeFilePath, filePath);
const contentFile = new aws.s3.BucketObject(
relativeFilePath,
{
key: relativeFilePath,
acl: "public-read",
bucket: bucket.id,
contentType: mime.getType(filePath) || undefined,
source: new pulumi.asset.FileAsset(filePath),
}
);
updatedFiles.push(contentFile);
});
})
This seems to be successful, I’m going to export the id and see if I need to applybillowy-army-68599
gorgeous-lunch-7514
09/08/2023, 2:02 PMbucket.id
over bucket
for new aws.s3.BucketObject
in the future
cheers for the help