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
If you start the local DynamoDB Docker instance without the -shareDb option, tables are not visible either to | |
the 'aws dynamodb' cli or DynamodDB Workbench: | |
docker run -d -p 8000:8000 amazon/dynamodb-local | |
If you start with the -shareDb option needed to see the tables, the container ends immediately. | |
Per answer on this question https://stackoverflow.com/questions/63835658/can-not-find-table-using-nosql-workbench-for-dynamodb-when-connecting-to-dynamod | |
start with -shareDb and all other default options: | |
docker run -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath . |
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
Resources: | |
roleResourceName: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: role-name | |
AssumeRolePolicyDocument: | |
Version: '2012-10-17' | |
Statement: | |
- Effect: Allow | |
Principal: |
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
If you call lambda.invokeAsync() from one lambda calling another, if the calling lambda completes/exits before the second | |
lambda has been successfully invoked then depending on the timing it's possible the second Lambda will not invoke sucessfully. | |
The SDK docs show calling invokeAsync with a callback: | |
const params = { | |
"FunctionName": "fucntion-name-to-invoke", | |
"InvokeArgs": JSON.stringify(payload-to-pass-to-lambda) | |
}; | |
lambda.invokeAsync(params, function (error, result) { |
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
Resources | |
- this section is the only required section in template | |
- you can define 1 to max 200 resources | |
AWSTemplateFormatVersion is optional | |
Parameters | |
- optional | |
- up to 60 per template | |
- Default - specify a default value if not passed |
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
fields @timestamp, @message | |
| filter @message like /string pattern to match/ | |
| sort @timestamp asc | |
fields @timestamp | |
| filter @message like /string pattern to match/ | |
#parse line, match a pattern, capture pattern match in this case * as named value userId | |
| parse "\"userId\": \"*\"" as userId | |
#only include where this has a value |
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
#list-functions is paginated by default so need to set page-size, no-paginate or simiilar to get complete list | |
# see https://docs.aws.amazon.com/cli/latest/reference/lambda/list-functions.html | |
# https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html | |
aws lambda list-functions --region us-west-2 | |
--query 'Functions[?starts_with(FunctionName, `name-pattern-here`) == `true`].FunctionName' | |
--page-size 300 >> 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
By default, @Target on one type, eg for properties: | |
@Target(ElementType.FIELD) | |
public @interface ExamplePropertyAnnotation | |
Specifying multiple targets as a List of target types: | |
@Target( { ElementType.FIELD, ElementType.PARAMETER } ) | |
public @interface ExamplePropertyAndParameterAnnotation |
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
Calling an api that doesn't exist in your API Gateway will return a 403 with the rather misleading response: | |
{ | |
"message": "Missing Authentication Token" | |
} |
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
#zsh git prompt customizations | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p' | |
} | |
COLOR_DEF=$'\e[0m' | |
COLOR_USR=$'\e[38;5;243m' | |
COLOR_DIR=$'\e[38;5;197m' | |
COLOR_GIT=$'\e[38;5;39m' | |
NEWLINE=$'\n' | |
setopt PROMPT_SUBST |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Example ECS Service", | |
"Parameters": { | |
"VPCSecurityGroupId": { | |
"Type": "String" | |
}, | |
"VPCSubnetId": { | |
"Type": "String" | |
} |
NewerOlder