Skip to content

Instantly share code, notes, and snippets.

# cloudformation package and deploy
aws cloudformation package --s3-bucket BUCKET-NAME --output-template-file packaged.yaml --region eu-west-1 --template-file template.yaml
aws cloudformation deploy --template-file packaged.yaml --stack-name STACK-NAME --parameter-overrides ParameterName=ParameterValue --capabilities CAPABILITY_IAM
aws kms encrypt --key-id #### --plaintext "onetwothree 123" --query CiphertextBlob --output text | base64 --decode > out.blob
aws kms decrypt --key-id #### --ciphertext-blob fileb://out.blob --query Plaintext --output text | base64 --decode
# pacakaging and deploying sam function
sam build --use-container -m ./requirements.txt
sam package --s3-bucket DEPLOYMENT-BUCKET --output-template-file packaged.yaml --region eu-west-1
sam deploy --template-file ./packaged.yaml --stack-name CLOUDFORMATION-STACK-NAME --capabilities CAPABILITY_IAM --region eu-west-1
cat test.json | gzip | openssl base64 -A > test.out