If you read my previous posts you can see that I am working with Golang and AWS a lot, so in this one, I will present how I deploy a serverless API in AWS Lambda with an API Gateway to access it.
I will write the API using GO
and go-chi/chi
to handle the http routing layer.
All the sources are available in thomaspoignant/cdk-golang-lambda-deployment repository
So the first things we will do is creating an API using go-chi
and the aws-lambda-go
SDK, so we need to import these dependencies:
go get github.com/aws/aws-lambda-go
go get github.com/awslabs/aws-lambda-go-api-proxygo get github.com/go-chi/chi go get…
Since I started using AWS CDK, I’ve been trying to use it for everything related to infrastructure. But I wanted to go a bit further and also manage my monitoring with it.
To achieve this, I am extending CloudFormation with the help of custom resources.
“Custom resources enable you to write custom provisioning logic in templates that AWS CloudFormation runs anytime you create, update (if you changed the custom resource), or delete stacks. For example, you might want to include resources that aren’t available as AWS CloudFormation resource types. You can include those resources by using custom resources. That way…
I love working with Go because it is easy to code and easy to build.
But like with all other programming languages, you have to deal with a lot of tooling. To have easy access to these tools, I put everything in a makefile so I can build
, lint
, and run
everything from a single place.
After building a lot of services, I now always use the same kind of makefile to help me properly build my projects. In this article, I will share what targets I use and why they are useful.
Note: Most of the targets use Docker…
A cache that periodically refreshes in the background is a common pattern that is used in several use cases, but how can we achieve this in Go? In this article, I will guide you through the concepts behind the implementation to help you understand how it works.
I absolutely don’t think human/manual QA gates should be involved in between the writing of code and its being live. To avoid breaking things every time and to have an early cutoff system, you should use feature flags.
There are a lot of systems available on the market to manage your flags, like LaunchDarkly or UNLEASH, that have Golang support — but this option is expensive, and you have to host a server somewhere to manage your flags.
From this starting point, I came up with the idea to create a simple library with only one file in the back…
AWS Cloud Development Kit, better known as CDK, is changing the way we do infrastructure as code by using a proper programming language to build your infra.
Since we are building infra with dev tools, we should have a CI/CD for our CDK stack code that looks like any other project. If you look online, AWS explains how to do CI/CD with code build/code pipeline, but these probably aren’t the tools you are using in your day-to-day.
In this article, I will present to you the deployment pipeline I’m using to deploy my CDK stack based on GitHub and TravisCI.
On my team, we recently introduced the principle of Architecture Decision Records.
An architectural decision record (ADR) is a document that captures an important architectural decision made along with its context and consequences.
This is an awesome and super-simple way to track our decisions, and it makes our product and team more future-proof.
The ADR framework is an awesome tool that helps new hires to understand how your team makes decisions and why your software looks the way it does.
You should write an ADR for almost everything that impacts the work of your engineers (large new decisions, undocumented team…
Some months ago I joined a new team, they were on AWS and using cloudformation for some stuff and, a lot of changes were made directly in the console.
After some discussion we’ve decided to start fresh on a new infrastructure code, with some constraint in mind:
GO
for the backend and scala
/python
for data.We have considered to re-work with Cloudformation and also with Terraform, but…
Observability and monitoring is a key tool to know how your product is going. There are thousands of good products to get this data and to evaluate these, but my favorites are datadog and honeycomb.io they are both super great in their expertise domain.
We are using datadog to monitor our infrastructure and to collect our logs and we are using honeycomb for tracing, so honeycomb has the user vision when datadog has the infrastructure vision.
We have one problem here is that these 2 visions are not connected, so sometimes it is hard to understand what we see in…
A bastion host is a server whose purpose is to provide access to a private network from an external network, such as the Internet. With the public cloud era, this is one of the favorite ways to access your private resources.
Let’s say you want to SSH your EC2 instance in your private subnet you can use the bastion which is in a public subnet to forward your traffic to your EC2 without to open public access to the EC2.
Techlead and cloud architect, I like to build great apps and deploy them on the cloud ☁️ ☁️ ☁️ #aws #go #java ☕️ #typescript #cicd