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 Log from "@dazn/lambda-powertools-logger" | |
import { | |
LambdaClient, | |
ListFunctionsCommand, | |
ListFunctionsCommandOutput, | |
ListTagsCommand, | |
} from "@aws-sdk/client-lambda" | |
const lambda = new LambdaClient({}) |
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
# I want to run Locust (https://locust.io) inside of a Fargate container and pulling the Locustfile from S3. | |
# My thought was that I would use S3FS to do that, but that requires privileged mode, which Fargate doesn't | |
# do. So S3FS isn't going to work, but I thought putting the Dockerfile up here might prove useful at some point. | |
FROM paterit/locustio AS base | |
RUN apk update | |
RUN apk add --no-cache \ | |
fuse \ | |
curl \ | |
libxml2 |
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
// Take a configuration stored in SSM as a series of hierarchical path / value pairs and return it as an object | |
import { | |
GetParametersByPathCommand, | |
GetParametersByPathCommandOutput, | |
SSMClient, | |
} from '@aws-sdk/client-ssm | |
async function getBackupConfig = async (parameterRoot: string) => { | |
const ssm = new SSMClient({}) | |
let NextToken: string |
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
// A sketch demonstrating a way to take "/" delimited paths (e.g. '/foo/bar', '/foo/baz', '/foo/bak/quux', '/foo/bak/quuy') | |
// and put them into a single object where the keys match the path hierarchy. | |
const pathVals = { '/foo/bar/baz': 1, '/foo/bar/bak': 2, '/foo/quux': 11, '/alpha': 13 } | |
// Expected: | |
//{ | |
// foo: { | |
// bar: { | |
// baz: 1, |
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 util = require('util'); | |
const zlib = require('zlib'); | |
const gzip = util.promisify(zlib.gzip); | |
const gunzip = util.promisify(zlib.gunzip); | |
const encodeGzippedJson = async (obj) => { | |
const gzBuf = await gzip(JSON.stringify(obj)); | |
return JSON.stringify(gzBuf); | |
} |
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
/* | |
This came about because I needed to get a VPC name that was a function of the deployment stage | |
(e.g. 'my-vpc-dev', 'my-vpc-qa', etc.). I could have just hardcoded the VPC name in serverless.yml and edited it for | |
each deploy, but where's the fun in that? | |
What this does is to take a value from serverless.yml like "my-vpc-${self:custom.stage}" and interpolate the variable | |
"${self:custom.stage}" embedded therein. This variable could resolve to another variable, so it gets called recursively. | |
Note that the construction "${opt:stage, self:provider.stage}" should be interpreted as | |
${opt:stage} || ${self:provider.stage} | |
*/ |
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
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Desktop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: GenuineIntel | |
CPU Brand: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz | |
CPU Family: 0x6 |
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 { customResourceHelper, ResourceHandler, ResourceHandlerReturn } = require('custom-resource-helper') | |
module.exports.handler = customResourceHelper(() => ({ | |
onCreate: async (event, context, logger) => { | |
// Place your code to handle Create events here. | |
const physicalResourceId = 'myResourceId' | |
const responseData = {} | |
console.log('CREATE event: ', event) | |
console.log('Logger: ', logger) | |
return { | |
physicalResourceId, |
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
{"lastUpload":"2020-03-25T16:56:24.822Z","extensionVersion":"v3.4.3"} |
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 express = require('express') | |
const app = express() | |
const port = 80 | |
const bodyParser = require('body-parser') | |
const crypto = require('crypto') | |
const secret = process.env.WEBHOOK_SECRET | |
app.use( | |
bodyParser.urlencoded({ | |
extended: true | |
}) |
NewerOlder