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
| it('Should connect to local table', async () => { | |
| const tableName = await getTableName(); | |
| assert(tableName); | |
| const dynamoDB = await connect(); | |
| assert(dynamoDB); | |
| const tableInfo = await dynamoDB | |
| .describeTable({ TableName: tableName }) | |
| .promise(); | |
| assert(tableInfo.Table?.TableStatus === 'ACTIVE'); |
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
| export const createMigrations = (): InputMigrations<DynamoDBContext> => { | |
| return [ | |
| { | |
| name: '00-dummy-migration', | |
| async up({ context }) { | |
| await context.client | |
| .putItem({ | |
| TableName: context.tableName, | |
| Item: marshall({ | |
| pk: '#DUMMY', |
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 res = client | |
| .createTable({ | |
| TableName: tableName, | |
| AttributeDefinitions: [ | |
| { | |
| AttributeName: 'pk', | |
| AttributeType: 'S', | |
| }, | |
| { | |
| AttributeName: 'sk', |
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
| 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}" | |
| } |
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
| 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 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 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 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
| 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 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
| data "aws_route53_zone" "main" { | |
| name = var.hosted_zone_domain | |
| private_zone = false | |
| } |
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
| { | |
| "$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 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
| 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}`, | |
| }); |