Skip to content

Instantly share code, notes, and snippets.

View mxro's full-sized avatar

Max Rohde mxro

View GitHub Profile
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');
export const createMigrations = (): InputMigrations<DynamoDBContext> => {
return [
{
name: '00-dummy-migration',
async up({ context }) {
await context.client
.putItem({
TableName: context.tableName,
Item: marshall({
pk: '#DUMMY',
const res = client
.createTable({
TableName: tableName,
AttributeDefinitions: [
{
AttributeName: 'pk',
AttributeType: 'S',
},
{
AttributeName: 'sk',
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}"
}
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.',
},
import SES from 'aws-sdk/clients/ses';
const awsUser = new AWS.SharedIniFileCredentials();
const ses = new SES({
apiVersion: '2010-12-01',
credentials: awsUser,
region: '[region]',
});
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)
data "aws_route53_zone" "main" {
name = var.hosted_zone_domain
private_zone = false
}
{
"$schema": "./schemas/package.schema.json",
"name": "lambda-express-template",
"template": "lambda-express",
"templateVersion": "0.1.0",
"configuration": {},
"deployments": [
{
"name": "prod",
"awsRegion": "us-west-2",
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}`,
});