AllowCognitoInvokeLambdaFunctionPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:invokeFunction
FunctionName: !GetAtt LambdaFunction.Arn
Principal: cognito-idp.amazonaws.com
SourceArn: !Sub arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/<COGNITO_USER_POOL_ID>
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
#!/bin/bash | |
export AWS_PROFILE=<PROFILE_NAME> # defined in .aws/config, e.g. system-admin | |
aws sts get-caller-identity |
https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf
https://help.github.com/articles/dealing-with-line-endings/
# view current setting
# system wide %ProgramFiles(x86)%\git\etc\gitconfig
# per user ~/.gitconfig
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
#!/bin/bash | |
set -euf -o pipefail | |
usage() { | |
echo "Usage: $0 -e [dev|test|preprod|prod] -t [encrypted text in base64]" 1>&2; | |
exit 1; | |
} | |
[ $# -eq 0 ] && usage |
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
# Terminal | |
export TERM="xterm-color" | |
PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ ' | |
export CLICOLOR=1 | |
export LSCOLORS=Exfxcxdxbxegedabagacad | |
export GREP_OPTIONS='--color=auto' | |
# Alias |
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
private static final Charset UTF_8 = Charset.forName("UTF-8"); | |
private static final Pattern JWT_PATTERN = Pattern.compile("^([a-zA-Z0-9\\-_]+=*)\\.([a-zA-Z0-9\\-_]+=*)\\.([a-zA-Z0-9\\-_]+=*)$"); | |
Matcher matcher = JWT_PATTERN.matcher(jwt); | |
if (matcher.matches()) | |
{ | |
String header = matcher.group(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
import java.security.*; | |
import java.security.spec.*; | |
public static java.security.Key publicKeyFromPEMString() | |
{ | |
String devPublicKey = "-----BEGIN PUBLIC KEY-----\n" | |
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsXn7MZWEOr1egercQtIk\n" | |
+ "......\n" |
Tag is metadata of a resource; allow up to 50 tag per resource.
Why tagging resource
- Reporting: in AWS console or billing reports
- Management: tools like
Stax
use tags to group and classify your cloud data - Permissions: can restrict permission based on tag data
- Filtering: AWS Resource Groups allow the console to be filtered based on tag
- Automated Processes: used to drive scheduled shutdowns, backup policies, or AWS config policies