Skip to content

Commit

Permalink
aws sam and lambda commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jserrao authored May 27, 2020
1 parent 24b0ec9 commit 53d70be
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,21 @@
05. `aws ec2 describe-instances --profile user-name` (shows you config profile for a given user on a given AWS service, ec2 in this example)
06. `aws iam upload-server-certificate --server-certificate-name STAR_example_com --certificate-body file://STAR_example_com.crt --private-key file://star_example_com.pem --certificate-chain file://ca-chain-amazon.crt --path /cloudfront/*/` (uploads an SSL certificate to AWS IAM service)
07. `aws iam update-server-certificate` (updates AWS IAM SSL certificates)
08. `aws iam get-server-certificate --server-certificate-name STAR_example_com` (gets you the details of a current SSL certificate)
08. `aws iam get-server-certificate --server-certificate-name STAR_example_com` (gets you the details of a current SSL certificate)

## AWS Lambda

01. `aws lambda create-alias --function-name your-function-name-here --description "alias for live version of function" --function-version 1 --name your-alias-name-here` (creates an alias for your functions, so you can push new versions up easily)
02. `aws lambda update-alias --function-name your-function-name-here --function-version 3 --name your-alias-name-here` (update alias versions of function name)


### AWS SAM CLI

01. `sam --version` (gets version of SAM)
02. `sam build` (downloads dependencies and runtime you need, ie. Node for JS)
03. `sam local start-api` (sets up a local endpoint for testing an API, defaults to running on `localhost:3000`)
`sam generate-event` (mock sample payloads from event sources)
04. `sam package --template-file template.yaml --output-template packaged-template.yaml --s3-bucket your-bucket-here` (how to packge up a serverless function for deployment)
05. `sam deploy --template-file packaged-template.yaml --stack-name your-stack-here --capabilities SNAKE_CASE_HERE` (moves the built package into the 'action' environment in AWS, so it's basically ready to receive invocations from events)
06. `sam invoke` (literally invokes a Lambda function one time)
07. `sam start-lambda` (starts the endpoint for local testing)

0 comments on commit 53d70be

Please sign in to comment.