Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
sudo yum update | |
sudo yum install -y docker | |
sudo usermod -a -G docker ec2-user | |
sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo service docker start | |
sudo chkconfig docker on |
# One Docker registry that we will use both for the Laravel application | |
# image and our Nginx image. | |
# Note that if you give a name to the repository, CloudFormation can't | |
# update it without a full replacement. | |
ECR: | |
Type: AWS::ECR::Repository | |
Properties: | |
# RepositoryName: !Sub ${AWS::StackName}-nginx | |
RepositoryPolicyText: | |
Version: "2012-10-17" |
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli | |
KEY_ID=alias/my-key | |
SECRET_BLOB_PATH=fileb://my-secret-blob | |
SECRET_TEXT="my secret text" | |
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob | |
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target | |
encrypt-text: |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
import bpy | |
def strVector3( v3 ): | |
return str(v3.x) + "," + str(v3.y) + "," + str(v3.z) | |
# create a new cube | |
bpy.ops.mesh.primitive_cube_add() | |
# newly created cube will be automatically selected | |
cube = bpy.context.selected_objects[0] |
# Official framework image. Look for the different tagged releases at: | |
# https://hub.docker.com/r/library/node/tags/ | |
image: node:6 | |
before_script: | |
- npm install | |
# This folder is cached between builds | |
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache | |
cache: |
This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.
First be sure to enable the Docker Remote API on the remote host.
This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.
#!/usr/bin/env bash | |
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts] | |
where: | |
region - the AWS region | |
stack-name - the stack name | |
aws-cli-opts - extra options passed directly to create-stack/update-stack | |
" |