Skip to content

Instantly share code, notes, and snippets.

View ywauto83's full-sized avatar

ywauto83

View GitHub Profile
@ywauto83
ywauto83 / list.txt
Created May 4, 2020 11:25 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
@ywauto83
ywauto83 / Namedreturnvalues.md
Created May 3, 2020 14:03
Named return values

Named return values Go's return values may be named. If so, they are treated as variables defined at the top of the function.

These names should be used to document the meaning of the return values.

A return statement without arguments returns the named return values. This is known as a "naked" return.

Naked return statements should be used only in short functions, as with the example shown here. They can harm readability in longer functions.

@ywauto83
ywauto83 / .bash_profile
Created May 3, 2020 13:54
bash profile for golang
# as per https://medium.com/@krisma/gopath-and-goroot-set-up-in-mac-and-in-vscode-cf86d8503e57
export GOPATH=~/go/
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@ywauto83
ywauto83 / CfnInitMetadataBuilder.ts
Created April 12, 2020 00:10 — forked from brettswift/CfnInitMetadataBuilder.ts
CDK 1.10.1 - ASG Cloudformation Init example
import autoscaling = require("@aws-cdk/aws-autoscaling")
import scriptAssets = require("./CfnInitScriptAsset")
import iam = require('@aws-cdk/aws-iam')
import cdk = require('@aws-cdk/core')
/**
* Helpful context into what was built.
* Use these to get logical ID's when constructing your userdata.
*/
@ywauto83
ywauto83 / lambdaTriggerSfn.py
Created April 9, 2020 21:23
lambdaTriggerSfn
import json
import boto3
import uuid
client = boto3.client('stepfunctions')
def lambda_handler(event, context):
#INPUT -> { "TransactionId": "foo", "Type": "PURCHASE"}
transactionId = str(uuid.uuid1()) #90a0fce-sfhj45-fdsfsjh4-f23f
@ywauto83
ywauto83 / StepFunction-task-SNS.py
Created April 8, 2020 04:10
StepFunction-task-SNS
{
"Comment":"Transaction Processor State Machine Using SNS",
"StartAt":"ProcessTransaction",
"States":{
"ProcessTransaction":{
"Type":"Pass",
"Next":"BroadcastToSns"
},
"BroadcastToSns":{
"Type":"Task",
@ywauto83
ywauto83 / StepFunction-task-SQS.py
Created April 7, 2020 10:17
StepFunction-task-SQS
{
"Comment":"Transaction Processor State Machine Using SQS",
"StartAt":"ProcessTransaction",
"States":{
"ProcessTransaction":{
"Type":"Pass",
"Next":"BroadcastToSqs"
},
"BroadcastToSqs":{
"Type":"Task",