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
aws lambda invoke \ | |
--invocation-type RequestResponse \ | |
--function-name oom-dev-memory \ | |
--region eu-west-2 \ | |
--log-type Tail \ | |
--payload "{}" \ | |
output.txt |
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_launch_configuration" "ecs_cluster" { | |
name = "${var.environment}-${var.application}-ecs" | |
image_id = "${lookup(var.ecs_amis, var.region)}" | |
instance_type = "${var.ecs_instance_type}" | |
key_name = "${var.key_name}" | |
iam_instance_profile = "${aws_iam_instance_profile.ecs_cluster.name}" | |
security_groups = ["${aws_security_group.ecs-cluster-group.id}", "${aws_security_group.ecs-api.id}"] | |
user_data = "#!/bin/bash\necho ECS_CLUSTER=${aws_ecs_cluster.ecs_cluster.name} >> /etc/ecs/ecs.config" | |
lifecycle { |
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
[ | |
{ | |
"name": "${name}", | |
"image": "12327816371.dkr.ecr.eu-west-2.amazonaws.com/repository:${tag}", | |
"cpu": 128, | |
"memory": 128, | |
"entryPoint": [], | |
"environment": [ | |
{ | |
"name": "CONNECTION_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
{ | |
"sub": "<uuid_user_id>", | |
"aud": "...", | |
"email_verified": true, | |
"event_id": "<uuid>", | |
"token_use": "id", | |
"auth_time": 1513169066, | |
"iss": "https://cognito-idp.eu-west-2.amazonaws.com/eu-west-2_pool_id", | |
"cognito:username": "<uuid_user_id>", | |
"exp": 1513172666, |
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
GET / HTTP/1.1 | |
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI8dXVpZF91c2VyX2lkPiIsImF1ZCI6Ii4uLiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJldmVudF9pZCI6Ijx1dWlkPiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNTEzMTY5MDY2LCJpc3MiOiJodHRwczovL2NvZ25pdG8taWRwLmV1LXdlc3QtMi5hbWF6b25hd3MuY29tL2V1LXdlc3QtMl9wb29sX2lkIiwiY29nbml0bzp1c2VybmFtZSI6Ijx1dWlkX3VzZXJfaWQ-IiwiZXhwIjoxNTEzMTcyNjY2LCJpYXQiOjE1MTMxNjkwNjYsImVtYWlsIjoiPGVtYWlsPiJ9.9ywdi62LvgoRntmqERoynjCm9ygKqLPwQSBlWsI7ZjE | |
x-amzn-apigateway-api-id: id | |
Accept: application/json | |
User-Agent: AmazonAPIGateway_name | |
X-Amzn-Trace-Id: Root=1-5a312506-a72c08ef3a10edd4481c0441 | |
Host: 6804bc51.ngrok.io | |
X-Forwarded-For: ipv4 |
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
curl -H "Authorization: <cognito_idtoken>" https://xxxxxxx.execute-api.eu-west-2.amazonaws.com/dev |
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
{"message":"Unauthorized"} |
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 winston = require('winston'); | |
const MESSAGE = Symbol.for('message'); | |
const jsonFormatter = (logEntry) => { | |
const base = { timestamp: new Date() }; | |
const json = Object.assign(base, logEntry) | |
logEntry[MESSAGE] = JSON.stringify(json); | |
return logEntry; | |
} |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
"time" | |
"github.com/a-h/lexical/input" | |
"github.com/a-h/lexical/parse" | |
) |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"reflect" |