-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsst.config.ts
More file actions
36 lines (32 loc) · 1.12 KB
/
Copy pathsst.config.ts
File metadata and controls
36 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "boreal",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
region: "eu-west-1",
};
},
async run() {
const path = await import("path");
// 1. Create the S3 Bucket
const bucket = new sst.aws.Bucket("MyTemplateBucket", {
access: "public",
});
// 2. Upload the file to the bucket using the Pulumi AWS provider
const templateFilePath = path.join(process.cwd(), "packages/infra/boreal-template.yaml");
const templateFile = new aws.s3.BucketObject("MyTemplateFile", {
bucket: bucket.name,
key: "templates/boreal-template.yaml",
source: new $util.asset.FileAsset(templateFilePath),
contentType: "application/x-yaml",
});
// 3. Construct the S3 URL to use as your templateUrl
// Format: https://{bucket}.s3.{region}.amazonaws.com/{key}
const templateUrl = $interpolate`https://${bucket.name}.s3.${aws.config.region}.amazonaws.com/${templateFile.key}`;
return {
TemplateUrl: templateUrl,
};
},
});