@@ -9,13 +9,15 @@ import {
9
9
aws_certificatemanager as acm ,
10
10
aws_cloudfront as cloudfront ,
11
11
aws_cloudfront_origins as origins ,
12
+ aws_lambda as lambda ,
12
13
aws_route53 as route53 ,
13
14
aws_s3 as s3 ,
14
15
aws_s3_deployment as s3deploy ,
15
16
aws_route53_targets as targets ,
16
17
aws_wafv2 as wafv2 ,
17
18
} from 'aws-cdk-lib'
18
- import { projectPath } from '@stacksjs/path'
19
+ import { hasFiles } from '@stacksjs/storage'
20
+ import { path as p } from '@stacksjs/path'
19
21
import { app } from '@stacksjs/config'
20
22
21
23
export class StacksCloud extends Stack {
@@ -131,7 +133,7 @@ export class StacksCloud extends Stack {
131
133
} )
132
134
133
135
const docsSource = '../../../storage/app/docs'
134
- const websiteSource = app . docMode ? docsSource : '../../../storage/app/ public'
136
+ const websiteSource = app . docMode ? docsSource : '../../../storage/public'
135
137
const privateSource = '../../../storage/private'
136
138
137
139
new s3deploy . BucketDeployment ( this , 'DeployWebsite' , {
@@ -146,6 +148,14 @@ export class StacksCloud extends Stack {
146
148
destinationBucket : privateBucket ,
147
149
} )
148
150
151
+ const layer = new lambda . LayerVersion ( this , 'Stacks' , {
152
+ code : lambda . Code . fromAsset ( p . projectStoragePath ( 'app/cloud/bun-lambda-layer.zip' ) ) ,
153
+ compatibleRuntimes : [ lambda . Runtime . PROVIDED_AL2 , lambda . Runtime . PROVIDED ] ,
154
+ compatibleArchitectures : [ lambda . Architecture . ARM_64 ] ,
155
+ license : 'MIT' ,
156
+ description : 'Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager.' ,
157
+ } ) ;
158
+
149
159
if ( shouldDeployDocs ( ) ) {
150
160
this . deployDocs ( zone , originAccessIdentity , webAcl , docsSource , logBucket )
151
161
}
@@ -248,10 +258,10 @@ export class StacksCloud extends Stack {
248
258
distributionPaths : [ '/*' ] ,
249
259
} )
250
260
251
- new Output ( this , 'DocsBucketName' , {
252
- value : docsBucket . bucketName ,
253
- description : 'The name of the docs bucket' ,
254
- } )
261
+ // new Output(this, 'DocsBucketName', {
262
+ // value: docsBucket.bucketName,
263
+ // description: 'The name of the docs bucket',
264
+ // })
255
265
256
266
// Prints out the web endpoint to the terminal
257
267
new Output ( this , 'DocsUrl' , {
@@ -262,5 +272,5 @@ export class StacksCloud extends Stack {
262
272
}
263
273
264
274
function shouldDeployDocs ( ) {
265
- return hasFiles ( projectPath ( 'docs' ) )
275
+ return hasFiles ( p . projectPath ( 'docs' ) )
266
276
}
0 commit comments