curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
(downloads AWS bundle, requires python and pip)unzip awscli-bundle.zip
(unzips AWS)sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
(installs bundle)aws configure --profile user
(sets up access key ID, secret access key, aws region and output format defaults for using AWS CLI)aws ec2 describe-instances --profile user-name
(shows you config profile for a given user on a given AWS service, ec2 in this example)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)aws iam update-server-certificate
(updates AWS IAM SSL certificates)aws iam get-server-certificate --server-certificate-name STAR_example_com
(gets you the details of a current SSL certificate)
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)aws lambda update-alias --function-name your-function-name-here --function-version 3 --name your-alias-name-here
(update alias versions of function name)
sam --version
(gets version of SAM)sam build
(downloads dependencies and runtime you need, ie. Node for JS)sam local start-api
(sets up a local endpoint for testing an API, defaults to running onlocalhost:3000
)sam generate-event
(mock sample payloads from event sources)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)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)sam invoke
(literally invokes a Lambda function one time)sam start-lambda
(starts the endpoint for local testing)