This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo yum update -y | |
sudo yum install -y git nodejs | |
git -v # Check git version | |
node -v # Check node version | |
npm -v # Check npm version | |
npm i -g pm2 | |
export HOME=/home/ec2-user | |
pm2 -v # Check pm2 version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const withDelay = async <T,>(delay = 0, callback: () => T) => { | |
await new Promise(resolve => setTimeout(resolve, delay)); | |
return callback(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Stack } from "aws-cdk-lib"; | |
import { BehaviorOptions, Function, FunctionCode, FunctionEventType } from "aws-cdk-lib/aws-cloudfront"; | |
import { HttpOrigin } from "aws-cdk-lib/aws-cloudfront-origins"; | |
import { join } from "path"; | |
export const getRedirectBehavior = (scope: Stack, id: string, location: string): BehaviorOptions => { | |
const redirectFilePath = join(__dirname, 'redirect-function.js'); | |
const redirectFunctionCode = FunctionCode.fromFile({ filePath: redirectFilePath }); | |
const redirectFunction = new Function(scope, `${id}-default-redirect-function`, { | |
code: redirectFunctionCode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S3AssetCopyFunction: | |
Type: AWS::Lambda::Function | |
Properties: | |
FunctionName: S3AssetCopy | |
Handler: index.handler | |
Role: !GetAtt LambdaExecutionRole.Arn | |
MemorySize: 4096 | |
Runtime: python3.12 | |
Timeout: 30 | |
Code: |
OlderNewer