Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(parent, id, props) {
super(parent, id, props);
// Copy the static files into the static S3 bucket
this.s3Deployment = new s3Deployment.BucketDeployment(this, 'deploy-web', {
source: s3Deployment.Source.asset('./static'),
destinationBucket: props.staticBucket,
});
// Create a lambda that regenerates the homepage
const regenerateHomepage = new lambda.Function(this, 'regenerate-homepage', {
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'regenerate-homepage.handle',
code: lambda.Code.asset('./app/regenerate-homepage'),
environment: {
CHANGELOGS_TABLE_NAME: props.changelogsTable.tableName,
FEEDS_TABLE_NAME: props.feedsTable.tableName,
WEB_BUCKET_NAME: props.webBucket.bucketName
}
});
// Grant the lambda permission to read the tables
sources: staticPages.map(page =>
s3Upload.Source.asset(`./.next/serverless/${page}`)
),