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
| aws comprehend detect-sentiment --text "What is the difference between a Zippo and a hippo? ✔ 10:44:06 | |
| Ones really heavy, and the other is a little lighter" --language-code "en" | |
| { | |
| "SentimentScore": { | |
| "Mixed": 0.047000035643577576, | |
| "Positive": 0.22732417285442352, | |
| "Neutral": 0.5861609578132629, | |
| "Negative": 0.13951489329338074 | |
| }, | |
| "Sentiment": "NEUTRAL" |
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
| stream: arn:aws:dynamodb:us-east-1:xxxxxxxxxxx:table/global2/stream/2018-05-14T21:09:15.761 |
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
| http POST https://global.adhorn.me/create "session_comment"="It is a love hate relationship" "item_id"="newfoobar" ✔ 10:44:23 | |
| HTTP/1.1 200 OK | |
| Connection: keep-alive | |
| Content-Length: 23 | |
| Content-Type: application/json | |
| Date: Thu, 24 May 2018 08:01:34 GMT | |
| X-Amzn-Trace-Id: Root=1-5b06715d-93f96b7aed2c93935e2f0437 | |
| x-amz-apigw-id: HYamrEtMPHcFSUQ= | |
| x-amzn-RequestId: ace920db-5f28-11e8-9a4f-8341de6cad86 |
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
| { | |
| u'Records':[ | |
| { | |
| u'eventID':u'09a77cc835e8baeeeec400efc3d69295', | |
| u'eventVersion':u'1.1', | |
| u'dynamodb':{ | |
| u'SequenceNumber':u'45152900000000035196046782', | |
| u'Keys':{ | |
| u'item_id':{ | |
| u'S':u'foobar11' |
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
| http POST https://global.adhorn.me/create "session_comment"="It is a love hate relationship" "item_id"="foobar11" ✔ 13:34:25 | |
| HTTP/1.1 200 OK | |
| Connection: keep-alive | |
| Content-Length: 24 | |
| Content-Type: application/json | |
| Date: Thu, 24 May 2018 10:46:14 GMT | |
| X-Amzn-Trace-Id: Root=1-5b0697f6-8fb9c837297aa8e2e7e2ab7b | |
| x-amz-apigw-id: HYyufGVvPHcF-OA= | |
| x-amzn-RequestId: ae185ab8-5f3f-11e8-9bc3-61481c62f7b2 |
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
| from __future__ import unicode_literals | |
| import sys | |
| import logging | |
| import boto3 | |
| import os | |
| log = logging.getLogger() | |
| log.setLevel(logging.DEBUG) | |
| sys.path.insert(0, './vendored') |
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
| aws dynamodb describe-table --table-name global2 --region us-east-1 --query "Table.LatestStreamArn" | |
| "arn:aws:dynamodb:us-east-1:xxxxxxxxxxxx:table/global2/stream/2018-05-14T21:09:15.761" |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": "sqs:ListQueues", | |
| "Resource": "*" | |
| }, | |
| { | |
| "Effect": "Allow", |
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 json | |
| def lambda_handler(event, context): | |
| body = { | |
| "message": "Hello SQS", | |
| "event": event | |
| } | |
| print json.dumps(body) |
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
| START | |
| Create a Base AMI and harden it if you have too. | |
| IF DOCKER: | |
| Create base Container with libraries and dependencies and store it in your container hub (you don't want to recreate the whole container every time) | |
| Create an as-light-as possible Dockerfile (used a base container) | |
| Copy code on build into Docker Container (run dockerfile) | |
| Deploy Container to base AMI |