Skip to content

Instantly share code, notes, and snippets.

@cguillemette
Last active January 4, 2024 16:20
Show Gist options
  • Save cguillemette/d41f64ec9155e52482cf8ccea5f0230d to your computer and use it in GitHub Desktop.
Save cguillemette/d41f64ec9155e52482cf8ccea5f0230d to your computer and use it in GitHub Desktop.
CLI cheat sheet

Docker

# Passthrough AWS credentials to docker
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
# Debug a flask app 
$ docker-compose run -p 8000:8000 svc1 python3 -m pdb app.py

AWS SAM

# Build, deploy and beep
$ sam build && sam deploy && print \\a
# Tail logs
$ sam logs --stack-name mktbot-serverless --tail
# Supports hot reloading (this runs all lambdas)
$ sam local start-api

# If you use the --debug flag, you will see the Event payload.
$ sam local start-api --debug
# Supply event payload to a Lambda
sam local invoke <NAME-OF-FUNCTION> -e <FILEPATH-WITH-EVENT-PAYLOAD>
# List all the pods available
$ kubectl get pods -n <namespace>
# List all URL mapping available
$ kubectl get mapping -n <namespace>
# List all deployments
$ kubectl get deployment -n <namespace>
# List all services
$ kubectl get services -n <namespace>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment