This file contains 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 { build } from 'esbuild'; | |
import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp'; | |
build({ | |
plugins: [pnpPlugin()], | |
bundle: true, | |
entryPoints: ['src/lambda.ts'], | |
external: ['aws-sdk'], | |
minify: true, | |
format: 'cjs', |
This file contains 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
/* eslint-disable @typescript-eslint/no-var-requires */ | |
/* eslint-disable @typescript-eslint/no-unused-vars */ | |
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | |
const withPlugins = require('next-compose-plugins'); | |
const getLocalPackages = require('./scripts/getLocalPackages'); | |
const localPackages = getLocalPackages.getLocalPackages(); | |
const withTM = require('next-transpile-modules')(localPackages); | |
This file contains 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
resource "aws_lambda_function" "main" { | |
function_name = var.lambda_name | |
filename = data.archive_file.empty_lambda.output_path | |
handler = "lambda.handler" | |
runtime = "nodejs12.x" | |
memory_size = 2048 | |
timeout = 900 |
This file contains 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
awsCli({ | |
credentials: await getAWSUser(params.deployment.awsUser), | |
region: params.deployment.awsRegion, | |
command: `lambda update-function-code --function-name ${readTerraformStateVariable( | |
params.deploymentState, | |
'lambda_function_name' | |
)} --zip-file fileb://${targetArchive}`, | |
}); |
This file contains 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
{ | |
"$schema": "./schemas/package.schema.json", | |
"name": "lambda-express-template", | |
"template": "lambda-express", | |
"templateVersion": "0.1.0", | |
"configuration": {}, | |
"deployments": [ | |
{ | |
"name": "prod", | |
"awsRegion": "us-west-2", |
This file contains 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
data "aws_route53_zone" "main" { | |
name = var.hosted_zone_domain | |
private_zone = false | |
} |
This file contains 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
resource "aws_route53_record" "amazonses_verification_record" { | |
zone_id = data.aws_route53_zone.main.zone_id | |
name = "_amazonses.${var.domain}" | |
type = "TXT" | |
ttl = "600" | |
records = [join("", aws_ses_domain_identity.ses_domain.*.verification_token)] | |
} | |
resource "aws_ses_domain_dkim" "ses_domain_dkim" { | |
domain = join("", aws_ses_domain_identity.ses_domain.*.domain) |
This file contains 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 SES from 'aws-sdk/clients/ses'; | |
const awsUser = new AWS.SharedIniFileCredentials(); | |
const ses = new SES({ | |
apiVersion: '2010-12-01', | |
credentials: awsUser, | |
region: '[region]', | |
}); |
This file contains 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
await ses | |
.sendEmail({ | |
Destination: { ToAddresses: ['test@test.com'] }, | |
Message: { | |
Subject: { Charset: 'UTF-8', Data: 'Test email' }, | |
Body: { | |
Text: { | |
Charset: 'UTF-8', | |
Data: 'This is the message body in text format.', | |
}, |
This file contains 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
resource "aws_ses_domain_identity" "ses_domain" { | |
domain = var.domain | |
} | |
resource "aws_ses_domain_mail_from" "main" { | |
domain = aws_ses_domain_identity.ses_domain.domain | |
mail_from_domain = "mail.${var.domain}" | |
} |