We’ve recently faced an issue when deploying a repository containing submodules while using Code Pipeline. First, let’s understand how Code Pipeline pulls data from Github.
Let’s say we have a very simple deployment process like this:
1- CodePipeline pulls a specific branch from a repository
2- CodeBuild receives the files and the build/compiling process happens with a buildspec.yml file.
OK, so ideally what we would do is simply run
git submodules init and
git submodules update --recursive in our buildspec.yml file and it should be all set, right?
Not really. When CodePipeline pulls the files from your repository and passes to CodeBuild, it actually doesn’t include the
.git directory, that being said, we can’t perform any Git actions because it is no longer is a Git repository. …
API Gateway allows us to create not only REST APIs but also WebSockets. With API Gateway, you can proxy all of your requests to a Lambda Function which will handle the back-end service for us. At the end of this article you will find the Github Repository with the Back-End services as well as a JS example on the client side.
First, let’s setup a WebSocket API in AWS.
Open up the API Gateway service, hit Create API and select WebSocket.
The Route Selection Expression is the one that will determine which route and eventually which Lambda function will be called when an incoming request reaches API Gateway. For this example, let’s use
$request.body.action which means the
action property in a Request Payload. …
Serverless makes you focus on your code instead of thinking about provisioning instances and managing servers. Here in this article, we will deploy a basic Node.js web app to AWS Lambda within minutes.
First, you need to install the Serverless Framework globally with npm. That’s the tool that will handle the easy deployment for you.
npm install -g serverless
Now, let’s create a new project with an AWS Node.js template.
mkdir my-serverless && cd my-serverlessserverless create -t aws-nodejs
You can literally use any language supported by AWS Lambda. Check Servless docs for more info.
This will generate a new Serverless project for you and as we can see in the picture below, we only have two files. …