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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Deny", | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], |
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
const MAX_LINES = 30000 | |
export const handler = awslambda.streamifyResponse(async (_event, responseStream, _context) => { | |
await new Promise((resolve, _reject) => { | |
let i = 1 | |
responseStream.on('error', (err) => { | |
console.error('error:', err) | |
_reject(err) | |
}) | |
responseStream.on('close', () => { | |
console.log('closed') |
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
'use strict'; | |
const { DynamoDBClient } = require("@aws-sdk/client-dynamodb"); | |
const { DynamoDBDocumentClient, PutCommand } = require("@aws-sdk/lib-dynamodb"); | |
const dynamoClient = new DynamoDBClient({ region: process.env.AWS_REGION }); | |
const ddbClient = DynamoDBDocumentClient.from(dynamoClient); | |
const { SNSClient, PublishBatchCommand } = require("@aws-sdk/client-sns"); | |
const snsClient = new SNSClient({ region: process.env.AWS_REGION }) | |
const { v4: uuidv4 } = require("uuid"); |
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
'use strict'; | |
const { DynamoDBClient } = require("@aws-sdk/client-dynamodb"); | |
const { DynamoDBDocumentClient, PutCommand } = require("@aws-sdk/lib-dynamodb"); | |
const dynamoClient = new DynamoDBClient({ region: process.env.AWS_REGION }); | |
const ddbClient = DynamoDBDocumentClient.from(dynamoClient); | |
let snsClient, PublishBatchCommand, SNSClient | |
const { v4: uuidv4 } = require("uuid"); |
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
/** Copyright 2019,2020,2021,2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ | |
// node_modules/lambda-runtime/dist/node16/index.mjs // AJ - I double checked, this was pulled from `public.ecr.aws/lambda/nodejs:18`, AWS did not change this comment ¯\_(ツ)_/¯ | |
import { createRequire } from "module"; | |
var require2 = createRequire(import.meta.url); | |
var __defProp = Object.defineProperty; | |
var __defProps = Object.defineProperties; | |
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
var __getOwnPropNames = Object.getOwnPropertyNames; | |
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
var __hasOwnProp = Object.prototype.hasOwnProperty; |
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
# Rails has long supported database migrations to help you evolve your database schema over time. | |
# However, mature Rails applications often need migration-like tasks which may not alter the schema, or may have special considerations. | |
# Specifically, I've had to implement an after-deploy migration pattern, and a late night migration pattern. | |
# After-deploys are used for non-schema changes. If I have a bunch of corrupt data to clean up, or a 1-time import to process, | |
# which doesn't really demand its own rake task. | |
# Late-night migrations might be schema changes that can lock a table or cause other issues that would arise during the day. | |
# Rails 5 introduced multi-database support, which also often benefits from multiple directories for migrations. You can leverage | |
# that logic and create a new task for special migrations like this | |
namespace :db do |