<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Thomas Poignant</title>
    <description>The latest articles on Forem by Thomas Poignant (@thomaspoignant).</description>
    <link>https://forem.com/thomaspoignant</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F420449%2Ffd6c1ffe-3b75-4c85-8a43-4ebba4582ef9.jpg</url>
      <title>Forem: Thomas Poignant</title>
      <link>https://forem.com/thomaspoignant</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/thomaspoignant"/>
    <language>en</language>
    <item>
      <title>Create a bastion with AWS CDK</title>
      <dc:creator>Thomas Poignant</dc:creator>
      <pubDate>Mon, 27 Jan 2025 08:15:38 +0000</pubDate>
      <link>https://forem.com/aws-builders/create-a-bastion-with-aws-cdk-1ik8</link>
      <guid>https://forem.com/aws-builders/create-a-bastion-with-aws-cdk-1ik8</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqc1ozidrk2jk30xh3z7o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqc1ozidrk2jk30xh3z7o.png" alt="Image description" width="720" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to manage your SSH key
&lt;/h2&gt;

&lt;p&gt;Managing your SSH keys in the bastion is the worst, it’s fine for a one-person project, as soon as you are a team with people leaving and some arriving you end up adding/removing keys all the time.&lt;/p&gt;

&lt;p&gt;For this typical use case AWS has created a service called &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html" rel="noopener noreferrer"&gt;&lt;code&gt;AWS Systems Manager Session Manager&lt;/code&gt;&lt;/a&gt; and as they said :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Session Manager provides secure and auditable instance management without the need to open inbound ports, maintain bastion hosts, or manage SSH keys.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;You will ask me why creating a bastion if we have &lt;code&gt;Session Manager&lt;/code&gt;?&lt;/strong&gt;&lt;br&gt;
A classic answer is to query a database located in a private subnet.&lt;/p&gt;


&lt;h2&gt;
  
  
  How to build our bastion with CDK
&lt;/h2&gt;

&lt;p&gt;AWS Cloud Development Kit (CDK) lets you create your infra using real languages. In this example, I will use python but CDK is also available for java, javascript, and typescript.&lt;/p&gt;

&lt;p&gt;The good thing when you want to create a bastion with CDK is that there is a construct for that:&lt;a href="https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.BastionHostLinux.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.BastionHostLinux.html&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This creates a linux bastion host you can use to connect to other instances or services in your VPC.&lt;/p&gt;

&lt;p&gt;The recommended way to connect to the bastion host is by using AWS Systems Manager Session Manager.&lt;br&gt;
The operating system is Amazon Linux 2 with the latest SSM agent installed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The file below will create a bastion with a security group associated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/thomaspoignant/b498e45f2f4c939e53e429ae9cdced39#file-bastion-py" rel="noopener noreferrer"&gt;https://gist.github.com/thomaspoignant/b498e45f2f4c939e53e429ae9cdced39#file-bastion-py&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So as you can see, first, we are creating a security group with no inbound port open (it means that the machine cannot be SSH from anywhere). After we are creating the bastion with a few parameters like the instance type, and where to start it (here in a public subnet) and we are setting the security group to the instance.&lt;/p&gt;


&lt;h2&gt;
  
  
  Deploy the CDK stack
&lt;/h2&gt;

&lt;p&gt;Now that our bastion configuration is ready, we just need to deploy the stack with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cdk deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because we are deploying some changes to a security group, CDK will prompt you to validate the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwmko0tyq5cb8r4ti6p2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwmko0tyq5cb8r4ti6p2.png" alt="Image description" width="800" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait till your stack is done. What it does is running a cloudformation in your AWS account and the command line gives you some information about what was built.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuatv4yg8fh9em1gb3t55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuatv4yg8fh9em1gb3t55.png" alt="Image description" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if you are going to the console you will be able to see that your new instance has started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgby5022f77yznlcww5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgby5022f77yznlcww5n.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Connect to the bastion
&lt;/h2&gt;

&lt;p&gt;To connect to the bastion you need to have your &lt;code&gt;aws cli&lt;/code&gt; setup and your credentials stored.&lt;/p&gt;

&lt;p&gt;The first thing to do is to get the &lt;code&gt;InstanceId&lt;/code&gt; of your bastion. For that you can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;eu-west-3
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;BASTION_INSTANCE_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;aws ec2 describe-instances &lt;span class="se"&gt;\&lt;/span&gt;
                          &lt;span class="nt"&gt;--region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
                          &lt;span class="nt"&gt;--filter&lt;/span&gt; &lt;span class="s2"&gt;"Name=tag:Name,Values=my-bastion"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
                          &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"Reservations[].Instances[?State.Name == 'running'].InstanceId[]"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
                          &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have an environment variable called &lt;code&gt;BASTION_INSTANCE_ID&lt;/code&gt; with the InstanceId of your bastion.&lt;/p&gt;

&lt;p&gt;Now we can use AWS Session manager to access to the bastion:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ssm start-session &lt;span class="nt"&gt;--target&lt;/span&gt; &lt;span class="nv"&gt;$BASTION_INSTANCE_ID&lt;/span&gt; &lt;span class="nt"&gt;--region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By running this command every user of your account with the right IAM access will be able to connect to the instance. &lt;strong&gt;No SSH key to manage anymore&lt;/strong&gt;, all the access is given via the IAM policies.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With less than 40 lines of code, you can create a bastion with Session Manager using AWS CDK.&lt;/p&gt;

&lt;p&gt;All the complexity is hidden by the high-level construct of CDK, it means that you can be focused on what you want and not how to do it.&lt;/p&gt;

&lt;p&gt;I really ❤ CDK&lt;/p&gt;

</description>
      <category>cdk</category>
    </item>
    <item>
      <title>🚀 Announcing GO Feature Flag v1.0.0, get more from your feature flags</title>
      <dc:creator>Thomas Poignant</dc:creator>
      <pubDate>Fri, 03 Feb 2023 14:47:19 +0000</pubDate>
      <link>https://forem.com/thomaspoignant/announcing-go-feature-flag-v100-get-more-from-your-feature-flags-3dm3</link>
      <guid>https://forem.com/thomaspoignant/announcing-go-feature-flag-v100-get-more-from-your-feature-flags-3dm3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiotfpeiiqk8s5bl3lo31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiotfpeiiqk8s5bl3lo31.png" alt="Logo" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🚀 Announcing GO Feature Flag v1.0.0, get more from your feature flags
&lt;/h1&gt;

&lt;p&gt;We are so happy to finally announce that &lt;strong&gt;GO Feature Flag&lt;/strong&gt; v1.0.0 is released. 🎉 🥳 🚀&lt;/p&gt;

&lt;p&gt;It was a long journey before this release but we are happy to propose you an even better experience with feature flags always keeping simplicity in mind and building a lightweight solution.&lt;/p&gt;

&lt;p&gt;Our goal is still the same, we want you to experience the world of feature flags with a lightweight self-hosted solution.&lt;/p&gt;

&lt;p&gt;With this new version you will now be able to enhance your usage of feature flagging with opening the creation of more complex and more advance toggles.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is changing?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Flag configuration format
&lt;/h2&gt;

&lt;p&gt;The main change is the format of your flags configuration. &lt;/p&gt;

&lt;p&gt;After using the version &lt;code&gt;v0.x.x&lt;/code&gt; for quite some time we notice some limitation on the way our flag configuration was designed.&lt;br&gt;
It was hard to return more than 2 different values with the same flag and we wanted to find a better way to represent our flags to be more extensible.&lt;/p&gt;

&lt;p&gt;The new representation of the flag is a bit more verbose but allows a lot more possibility in the long term, being able to create more advanced flag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Old format:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the previous versions the flag representation was looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;test-flag&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;key eq "random-key"&lt;/span&gt;
  &lt;span class="na"&gt;percentage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40&lt;/span&gt;
  &lt;span class="na"&gt;true&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;false&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see on this example you can only have a value for the &lt;code&gt;true&lt;/code&gt; variation and for the &lt;code&gt;false&lt;/code&gt; variation, the &lt;code&gt;default&lt;/code&gt;variation was applying if the user was not part of the &lt;code&gt;rule&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;New format:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The same flag in the new format will looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;test-flag&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;variations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;variation_A&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;variation_B&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;targeting&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;key eq "random-key"&lt;/span&gt;
      &lt;span class="na"&gt;percentage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;variation_B&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
        &lt;span class="na"&gt;variation_A&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40&lt;/span&gt;
  &lt;span class="na"&gt;defaultRule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;variation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;variation_B&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the new format you have an unlimited number of variation possible you can define but also more than one rule for a specific flag.&lt;/p&gt;

&lt;p&gt;It allows to target different types of users with different values for the same feature flag.&lt;/p&gt;

&lt;p&gt;Let’s take a real life example, we want to get the background color for our website based on this criterias:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pro&lt;/code&gt; users should have a red background&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;enterprise&lt;/code&gt; users should have a green background&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;40%&lt;/strong&gt; of the &lt;code&gt;free&lt;/code&gt; users should have a &lt;strong&gt;grey&lt;/strong&gt; background and &lt;strong&gt;60%&lt;/strong&gt; a &lt;strong&gt;yellow&lt;/strong&gt; background&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;other types&lt;/strong&gt; of user have a white background&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can come-up with a flag, the configuration will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;user-background-color&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;variations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;pro&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#ff1f00&lt;/span&gt;
    &lt;span class="na"&gt;enterprise&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#114f03&lt;/span&gt;
    &lt;span class="na"&gt;free_grey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#b0b3af&lt;/span&gt;
    &lt;span class="na"&gt;free_yellow&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#ecec0a&lt;/span&gt;
    &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;#ffffff&lt;/span&gt;
  &lt;span class="na"&gt;targeting&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;type eq "pro"&lt;/span&gt;
      &lt;span class="na"&gt;variation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pro&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;type eq "enterprise"&lt;/span&gt;
      &lt;span class="na"&gt;variation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;enterprise&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;type eq "free"&lt;/span&gt;
      &lt;span class="na"&gt;percentage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;free_grey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40&lt;/span&gt;
        &lt;span class="na"&gt;free_yellow&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
  &lt;span class="na"&gt;defaultRule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;variation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we can have a way more advanced flag configuration with this new format. This format is solving all the limitation we had with the version &lt;code&gt;v0.x.x&lt;/code&gt; of &lt;strong&gt;GO Feature Flag&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrate from v0.x.x to v1.x.x
&lt;/h3&gt;

&lt;p&gt;First of all you should know that all flags from the version &lt;code&gt;v0.x.x&lt;/code&gt; are still compatible with this new version of &lt;strong&gt;GO Feature Flag&lt;/strong&gt;. We made it possible to reduce the disagreement to have to convert all your flag directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt; we encourage you to migrate your flag to the new version and for this we have created a tool called &lt;code&gt;go-feature-flag-migration-cli&lt;/code&gt; to convert flags in &lt;code&gt;v0.x.x&lt;/code&gt; format to &lt;code&gt;v1.0.0&lt;/code&gt; format.&lt;/p&gt;

&lt;p&gt;The easiest way to use it is probably to use our docker image like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;/your/configuration_folder:/config &lt;span class="se"&gt;\&lt;/span&gt;
  thomaspoignant/go-feature-flag-migration-cli:latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--input-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--input-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/config/my-go-feature-flag-config-v0.x.x.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/config/my-go-feature-flag-config-v1.x.x.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;We use the opportunity of the &lt;code&gt;v1.0.0&lt;/code&gt; to revamp our documentation and to highlight how you can use &lt;strong&gt;GO Feature Flag&lt;/strong&gt; in 2 different modes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The GO module&lt;/strong&gt;, this is where we started and this is the core of what we propose. In the documentation you will find all the information on how to use the module into your GO project.&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;Open-Feature&lt;/strong&gt;, the new open-source vendor agnostic standard for feature flags. You can use the &lt;code&gt;relay-proxy&lt;/code&gt; our server component that allows to use &lt;strong&gt;GO Feature Flag&lt;/strong&gt; with multiple languages &lt;em&gt;(for now we support &lt;code&gt;javascript&lt;/code&gt;, &lt;code&gt;typescript&lt;/code&gt;, &lt;code&gt;java&lt;/code&gt;, &lt;code&gt;GO&lt;/code&gt; and &lt;code&gt;.Net&lt;/code&gt;)&lt;/em&gt;. In the documentation you will find how to use the &lt;strong&gt;GO Feature Flag providers&lt;/strong&gt; in combination with the &lt;strong&gt;Open Feature SDKs&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Flag Editor
&lt;/h2&gt;

&lt;p&gt;Our old flag editor was not compatible anymore with the new &lt;code&gt;v1.0.0&lt;/code&gt; flag format. &lt;/p&gt;

&lt;p&gt;So we decided to restart our flag editor from scratch and to allow the possibility to create flags configuration from a simple UI. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgofeatureflag.org%2Fassets%2Fimages%2Fflag_editor-53ff4148297fa5d57431ab268cd5e52c.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgofeatureflag.org%2Fassets%2Fimages%2Fflag_editor-53ff4148297fa5d57431ab268cd5e52c.gif" alt="Flag editor" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now it is a tiny UI that make your life easier, but the goal is to evolve it more and more to be the place where you want to go to build your new feature flags.&lt;/p&gt;

&lt;h1&gt;
  
  
  What has not changed?
&lt;/h1&gt;

&lt;p&gt;Yes a lot of things have changed but our internals are solids and we have ensure to be consistent with the previous versions.&lt;/p&gt;

&lt;p&gt;Our main points of attention where the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User segmentation is similar between &lt;code&gt;v0.x.x&lt;/code&gt; and &lt;code&gt;v1.0.0&lt;/code&gt; meaning that if a user was affected by a flag (in a percentage for example) he will continue to be in the same cohort.&lt;/li&gt;
&lt;li&gt;All &lt;code&gt;retrievers&lt;/code&gt; and data &lt;code&gt;exporters&lt;/code&gt; have not changed and are still working exactly the same way as before.&lt;/li&gt;
&lt;li&gt;You can continue using &lt;strong&gt;GO Feature Flags&lt;/strong&gt; with your old flags.&lt;/li&gt;
&lt;li&gt;Moving to the version &lt;code&gt;v1.0.0&lt;/code&gt; is transparent and you just have to change the version.&lt;/li&gt;
&lt;li&gt;You can still use our advance rollout capabilities such as &lt;strong&gt;experimentation&lt;/strong&gt;, &lt;strong&gt;scheduled rollout&lt;/strong&gt;, &lt;strong&gt;progressive rollout …&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Feedback
&lt;/h1&gt;

&lt;p&gt;Feedbacks is our only way to evolve GO Feature Flag, so please contact us to give us any feedback.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Via &lt;a href="//mailto:contact@gofeaturegflag.org"&gt;email&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Via a &lt;a href="https://github.com/thomaspoignant/go-feature-flag/issues/new/choose" rel="noopener noreferrer"&gt;GitHub Issue&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cryptocurrency</category>
      <category>ethereum</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>10 things about AWS CDK</title>
      <dc:creator>Thomas Poignant</dc:creator>
      <pubDate>Thu, 02 Feb 2023 08:20:36 +0000</pubDate>
      <link>https://forem.com/aws-builders/10-things-about-aws-cdk-3cg8</link>
      <guid>https://forem.com/aws-builders/10-things-about-aws-cdk-3cg8</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;After some discussion we’ve decided to start fresh on a new infrastructure code, with some constraint in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We are not an OPS team but we are managing the infrastructure by our self.&lt;/li&gt;
&lt;li&gt;We want no manual action in the AWS console.&lt;/li&gt;
&lt;li&gt;The languages we are using in the team are &lt;code&gt;GO&lt;/code&gt; for the backend and &lt;code&gt;scala/python&lt;/code&gt; for data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have considered to re-work with Cloudformation and also with Terraform, but since no-one wanted to written thousands of lines of YAML we’ve decided to use AWS CDK.&lt;/p&gt;

&lt;p&gt;After all this journey of building our new stack, I can give you these 10 things to know before starting a CDK project (but I can already tell you that this is awesome).&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Write code in a real language, not YAML
&lt;/h2&gt;

&lt;p&gt;You probably know that if you have ever looked to CDK, but despite other infra-as-code technology you can write your stack in real language.&lt;br&gt;
&lt;strong&gt;Why this is better?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can keep your favorite tools to monitor your code, such as your IDE, your linters, quality checks …&lt;/li&gt;
&lt;li&gt;Describe your infra using an object model.&lt;/li&gt;
&lt;li&gt;You can do unit test your code. (This one is the awesome part 🙌 🙌 🙌)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  2. CDK support multi-language based on JSII
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JSII&lt;/code&gt; is a framework developed by the technology that enables the CDK to deliver polyglot libraries from a single codebase!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/aws/jsii" rel="noopener noreferrer"&gt;https://github.com/aws/jsii&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently AWS CDK is supporting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typescript / Javascript&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;.NET&lt;/li&gt;
&lt;li&gt;GO&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is awesome you can choose your favorite language in the list and start building your stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚠️ This is not that easy!&lt;/strong&gt;&lt;br&gt;
In my team, since there is no GO support in CDK we’ve decided to use Python because this is our second language.&lt;br&gt;
To be honest, this is not a bad choice everything works fine but it has some limits of not using Typescript/Javascript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why &lt;code&gt;typescript&lt;/code&gt; / &lt;code&gt;javascript&lt;/code&gt; is better?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All components are written with typescript at first, so you are sure that they will work for you. With other languages, it works perfectly if you are using default CDK constructs but as soon as you are using 3rd party constructs it less certain that it will work.&lt;/p&gt;

&lt;p&gt;And you can also have some weird documentation problems (see issues below).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/blimmer/cdk-datadog-integration/issues/15" rel="noopener noreferrer"&gt;Example of an issue I had with a 3rd party library.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aws/jsii/issues/1821" rel="noopener noreferrer"&gt;Weird documentation issue for python.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  3. CDK hides complexity
&lt;/h2&gt;

&lt;p&gt;Despite cloudformation or terraform where you have to write everything you want to have, CDK provides high-level constructs that do the work for you.&lt;/p&gt;

&lt;p&gt;For example, if you want to create a VPC with a set of subnets and associate Nat Gateways it can end up with a thousand lines of code CF or TF.&lt;/p&gt;

&lt;p&gt;With CDK most of the stuff is done automatically for you and you, as you can see with the code below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;subnet_configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SubnetConfiguration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Public&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;subnet_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SubnetType&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PUBLIC&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;cidr_mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;subnet_configuration&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SubnetConfiguration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;subnet_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SubnetType&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PRIVATE&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;cidr_mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;vpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Vpc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;test-vpc&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;subnet_configuration&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subnet_configuration&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;max_azs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;cidr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;10.0.0.0/16&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;nat_gateway_subnets&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Public&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;enable_dns_hostnames&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;enable_dns_support&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. CDK is based on cloud formation
&lt;/h2&gt;

&lt;p&gt;This one is really important to understand, CDK outputs some cloudformation code and apply it to your AWS account. So if something is not available in cloudformation it means that there is no chance you will be able to do it with CDK.&lt;/p&gt;

&lt;p&gt;But if like us you had a cloudformation stack before or if you want to import a 3rd party cloudformation script, you can do it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This code use a datadog CF template in a CDK stack.
&lt;/span&gt;&lt;span class="n"&gt;cfn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CfnStack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PolicyMacroStack&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;template_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;https://datadog-cloudformation-template.s3.amazonaws.com/aws/datadog_policy_macro.yaml&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. 🌬 CDK has a fast release cycle
&lt;/h2&gt;

&lt;p&gt;I’ve started my CDK project 4 months ago using version v1.42.0 of CDK.&lt;br&gt;
The actual version (when I write this article) is v1.74.0, which means that I have made 32 version updates on my actual stack.&lt;/p&gt;

&lt;p&gt;So be prepared to upgrade your dependencies all the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Experimental higher-level constructs
&lt;/h2&gt;

&lt;p&gt;Related to point 5, be warned that if you are using Experimental constructs you can expect some breaking changes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Experimental: Higher level constructs in this module that are marked as experimental are under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The good thing is that for every construct available (even if they are experimental) you still have access to CFN Resources which is basically a wrapper over cloudformation and these resources are always stable and safe to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Fine-grained assertions are only available for Typescript
&lt;/h2&gt;

&lt;p&gt;As I said before you can unit-test your infrastructure. That being said if you want to use the full power of testing with CDK, you are kind of stuck using javascript or typescript because you can use the fine-grained assertions framework.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fine-grained assertions test specific aspects of the generated AWS CloudFormation template, such as “this resource has this property with this value.”&lt;br&gt;
These tests help when you’re developing new features, since any code you add will cause your snapshot test to fail even if existing features still work. When this happens, your fine-grained tests will reassure you that the existing functionality is unaffected.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These fine-grained assertions are awesome because this makes it easy to test for real your expected stack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/cdk/latest/guide/testing.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/cdk/latest/guide/testing.html&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Nested stack vs Construct
&lt;/h2&gt;

&lt;p&gt;If you have a lot of components in your stack at some point the question will be how to structure it.&lt;/p&gt;

&lt;p&gt;You can use a lot of classes that extend Construct this the way most people are doing because before last week it was impossible to run a proper cdk diff to see what will be changed in your stack before deploying it.&lt;/p&gt;

&lt;p&gt;The problem with using Construct is that you can reach the 460,800 bytes limit from CloudFormation, and you can reach this limit quickly because CDK is doing a lot of stuff for you behind the scene.&lt;/p&gt;

&lt;p&gt;So in that case you can use some Nested Stacks, the problem was that when you were using nested stacks you were totally blind before applying changes. But last week Cloudformation has announced that changesets now support nested stacks.&lt;br&gt;
So if you want to split your stack, please use nested stacks now.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. CDK is multicloud
&lt;/h2&gt;

&lt;p&gt;CDK is a project from AWS, but now you can use it as a multi-cloud tool since Hashicorp has released CDK for terraforming.&lt;/p&gt;

&lt;p&gt;What it changes is that your CDK build will output some TF files, so it can apply in any cloud provider because terraform supports most of them.&lt;br&gt;
CDK for Terraform: Enabling Python &amp;amp; TypeScript Support&lt;br&gt;
Today, we are pleased to announce the community preview of the Cloud Development Kit for Terraform, a collaboration…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.hashicorp.com" rel="noopener noreferrer"&gt;https://www.hashicorp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see this project is really new, but it gives hope in the future of CDK and fingers crossed🤞 that it will become a standard even outside of AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. CDK everywhere (CDK8s, projen …)
&lt;/h2&gt;

&lt;p&gt;CDK is such a good idea that eladb (the creator of CDK) uses the CDK philosophy everywhere.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk8s&lt;/code&gt; is in beta and this is CDK for kubernetes, it is AWS agnostic and can be used on any K8S project.&lt;br&gt;
Even if this is a beta, you can already use it in production, the only visible tradeoff is that all kubernetes features are not implemented yet.&lt;/p&gt;

&lt;p&gt;eladb has also a side project called projen that allows you to create typescript/javascript project with a init script that maintains your config files (package.json, tsconfig.json, .gitignore …).&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I don’t regret to decide to use CDK instead of other technologies, it makes the work WAY easier and all the team understands what we are doing (not only the ops part of the team like before).&lt;/p&gt;

&lt;p&gt;This is a work in progress tools, but almost all major AWS component are already well covered so you don’t have to worry when you start building your stack and with less than 10k lines of codes we have built a complete infra where we managed a lot of components (VPC, subnets, security groups, EKS, Elasticsearch, secrets, IAM, monitoring …).&lt;/p&gt;

&lt;p&gt;My advice is to test CDK if you want a build a new stack, you will be convinced by your self after a few hours of using it.&lt;/p&gt;

</description>
      <category>cryptocurrency</category>
      <category>web3</category>
      <category>offers</category>
    </item>
    <item>
      <title>AWS CDK Continuous Integration and Delivery Using Travis CI</title>
      <dc:creator>Thomas Poignant</dc:creator>
      <pubDate>Thu, 03 Jun 2021 16:01:06 +0000</pubDate>
      <link>https://forem.com/aws-builders/aws-cdk-continuous-integration-and-delivery-using-travis-ci-kff</link>
      <guid>https://forem.com/aws-builders/aws-cdk-continuous-integration-and-delivery-using-travis-ci-kff</guid>
      <description>&lt;h2&gt;
  
  
  Ship infrastructure like you ship your code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/cdk/" rel="noopener noreferrer"&gt;AWS Cloud Development Kit&lt;/a&gt;, better known as CDK, is changing the way we do infrastructure as code by using a proper programming language to build your infra.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="https://docs.aws.amazon.com/cdk/latest/guide/cdk_pipeline.html" rel="noopener noreferrer"&gt;build/code pipeline&lt;/a&gt;, but these probably aren’t the tools you are using in your day-to-day.&lt;/p&gt;

&lt;p&gt;In this article, I will present to you the deployment pipeline I’m using to deploy my CDK stack based on GitHub and &lt;a href="https://travis-ci.org/" rel="noopener noreferrer"&gt;TravisCI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yv7eowv7i41lbd429mi.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yv7eowv7i41lbd429mi.jpeg" alt="Full CI/CD"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Continuous Integration
&lt;/h2&gt;

&lt;p&gt;Continuous integration looks like any code project CI. We validate our code, run the tests, and try to see if the build failed.&lt;/p&gt;

&lt;p&gt;This is run in every commit to ensure that we have the shortest feedback loop possible.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fch0dasp56n7osu0ghm75.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fch0dasp56n7osu0ghm75.jpeg" alt="CI process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in Travis configuration, it will look like something like below (here, we have a CDK Python stack):&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This CI is classic. We lint the code, test it, and export the coverage. We run cdk synth for each &lt;code&gt;stage&lt;/code&gt; on each commit to be sure that the config does not break one stage in particular.&lt;/p&gt;

&lt;p&gt;As you can see, we also use multiple Travis CI stages to run everything in parallel in order to have the shortest feedback loop possible.&lt;/p&gt;




&lt;h2&gt;
  
  
  Open Pull Requests to Validate Your Deployment
&lt;/h2&gt;

&lt;p&gt;The best strategy I have found to deploy the code to AWS is to have one branch per stage (&lt;code&gt;dev&lt;/code&gt;, &lt;code&gt;pre&lt;/code&gt;, &lt;code&gt;pro&lt;/code&gt;), so every time a new commit reaches one of these branches, we are deploying the actual stack. Yes, it looks like GitOps!&lt;/p&gt;

&lt;p&gt;But we don’t want to blindly deploy our CDK stack on an AWS account. So I have an automatic way of opening pull requests when something is merged to the main branch:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ktg95bacxlmzsm50e1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ktg95bacxlmzsm50e1g.png" alt="Process of opening pull request"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each time something is merged to the main branch, we have a specific job that runs &lt;code&gt;cdk diff -c stage=&amp;lt;STAGE&amp;gt;&lt;/code&gt; and opens a pull request to the destination branch.&lt;/p&gt;

&lt;p&gt;For that, we use the script below. As you can see, it runs &lt;code&gt;cdk diff&lt;/code&gt; and uses the results to open a pull request using the GitHub CLI:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we have to call this script inside Travis, so our &lt;code&gt;.travis.yaml&lt;/code&gt; file will look like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;As you can see, we are now using some env variables to specify our AWS Credentials in addition to our GitHub Token. Please make sure to encrypt them before committing them in your repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0755o2cuxf9nvba2cfao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0755o2cuxf9nvba2cfao.png" alt="cdk diff in GitHub pull request"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Continuous Deployment
&lt;/h2&gt;

&lt;p&gt;Now that you have your pull requests open for all your stages, it’s time to deploy the changes to your stack!&lt;/p&gt;

&lt;p&gt;On your PR comment, you are able to see the diff, so you will no longer be blind when it’s time to deploy a specific stage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97lpp2s1402ag9d1qjdm.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97lpp2s1402ag9d1qjdm.jpeg" alt="CD process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step for the CD is to deploy the stack. Each time we have a change in one of the release branches, we want to run &lt;code&gt;cdk deploy -c stage=&amp;lt;STAGE&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The complete &lt;code&gt;.travis.yaml&lt;/code&gt; file will look like this. As you can see, each &lt;code&gt;stage&lt;/code&gt; uses a condition for the deployment to be sure to apply it only to a specific &lt;code&gt;AWS stage&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With this GitOps approach, it is easy to understand what you’re deploying in your stack and all your changes are in Git.&lt;/p&gt;

&lt;p&gt;It also helps engineers with less knowledge in CDK to feel confident in the deployment of the infrastructure because no manual steps are required to deploy to a “real” AWS stage. The main advantage is that you are using the same tooling that you are using for the rest of your projects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Golang: Build and Deploy an AWS Lambda using CDK 🚀</title>
      <dc:creator>Thomas Poignant</dc:creator>
      <pubDate>Wed, 26 May 2021 15:21:18 +0000</pubDate>
      <link>https://forem.com/aws-builders/golang-build-and-deploy-an-aws-lambda-using-cdk-4jk3</link>
      <guid>https://forem.com/aws-builders/golang-build-and-deploy-an-aws-lambda-using-cdk-4jk3</guid>
      <description>&lt;p&gt;If you read my previous posts you can see that I am working with &lt;strong&gt;Golang&lt;/strong&gt; and &lt;strong&gt;AWS&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;I will write the API using &lt;code&gt;GO&lt;/code&gt; and &lt;code&gt;go-chi/chi&lt;/code&gt; to handle the http routing layer.&lt;/p&gt;

&lt;h1&gt;
  
  
  TL;DR
&lt;/h1&gt;

&lt;p&gt;All the sources are available in &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;&lt;code&gt;thomaspoignant/cdk-golang-lambda-deployment&lt;/code&gt;&lt;/a&gt; repository.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/thomaspoignant" rel="noopener noreferrer"&gt;
        thomaspoignant
      &lt;/a&gt; / &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;
        cdk-golang-lambda-deployment
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Create a serverless API in GO
&lt;/h1&gt;

&lt;p&gt;So the first things we will do is creating an API using &lt;code&gt;go-chi&lt;/code&gt; and the &lt;code&gt;aws-lambda-go&lt;/code&gt; SDK, so we need to import these dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;go&lt;/span&gt;
&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;awslabs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lambda&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;go&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxygo&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;go&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;chi&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;chi&lt;/span&gt;
&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;go&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;chi&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;render&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can see that we’ve also imported &lt;code&gt;github.com/awslabs/aws-lambda-go-api-proxy&lt;/code&gt; this framework allows using &lt;code&gt;go-chi&lt;/code&gt; with a lambda handler.&lt;/p&gt;

&lt;p&gt;Now we can create our &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment/blob/main/lambda/api/main.go" rel="noopener noreferrer"&gt;&lt;code&gt;main.go&lt;/code&gt;&lt;/a&gt; file that contains the logic of our API.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In this file, we have 2 important functions, &lt;code&gt;main()&lt;/code&gt; and &lt;code&gt;handler()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is important to understand that the &lt;code&gt;main()&lt;/code&gt; function is called only when the lambda is starting, so don’t do anything in the &lt;code&gt;main()&lt;/code&gt; if you want that action to happen for each API request.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;handler()&lt;/code&gt; function is where the lambda is called, so you will go on this function every time a request comes in, and since we are using a chiadapter the handler will use the &lt;code&gt;go-chi&lt;/code&gt; router to handle the requests.&lt;/p&gt;

&lt;p&gt;We are using this adapter to keep all the benefits from a framework to handle the http layer, it allows us to have better routing, but also to use some fancy helper to get your params, or write your responses &lt;em&gt;(in the repo we are using go-chi-render for that)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;👇You can check the repo to see the complete code of the lambda.👇&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/thomaspoignant" rel="noopener noreferrer"&gt;
        thomaspoignant
      &lt;/a&gt; / &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;
        cdk-golang-lambda-deployment
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Build &amp;amp; Deploy our lambda with CDK
&lt;/h1&gt;

&lt;p&gt;Now that our lambda function is ready we will have to build it and deploy it.&lt;/p&gt;

&lt;p&gt;So our CDK stack will contains these steps :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the GO binary we will use in our lambda&lt;/li&gt;
&lt;li&gt;Deploy the code as a lambda function&lt;/li&gt;
&lt;li&gt;Deploy an AWS API Gateway to access this API on the internet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create GO binary and deploy it
&lt;/h2&gt;

&lt;p&gt;Since we are using CDK it is to serve and build the lambda inside our infra as code.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;So as you can see the &lt;code&gt;lambda.Function&lt;/code&gt; object is taking 3 parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;runtime&lt;/code&gt;&lt;/strong&gt;: information on the language of the lambda (here we are using GO)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;handler&lt;/code&gt;&lt;/strong&gt;: the name of your go binary&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;code&lt;/code&gt;&lt;/strong&gt;: the code to run in the lambda, as you can see we are using &lt;code&gt;lambda.Code.fromAsset&lt;/code&gt; this takes the code location and create the binary from the code.
To execute the build, CDK is launching a docker image (you need docker on your machine) and use the makefile to build the binary with no dependency of the current machine running CDK.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Add an API Gateway to access the lambda
&lt;/h2&gt;

&lt;p&gt;Since lambda functions are not accessible directly through HTTP, let’s add an API Gateway in front of our lambda function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2m5r5iovm3yb34tqf2d.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2m5r5iovm3yb34tqf2d.jpeg" alt="arch schema"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doing this is super easy with CDK, this is only one object creation call to &lt;code&gt;LambdaRestApi&lt;/code&gt; with the lambda you just created and a description.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;It will do everything for you under the hood, by creating a &lt;code&gt;/{proxy+}&lt;/code&gt; route on the API Gateway and the associated deployment, it means that all the routes will go directly to lambda function and you have to manage the routing on your code, and this is &lt;strong&gt;EXACTLY&lt;/strong&gt; what we want to do!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ne17ochrdtopb2bfih2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ne17ochrdtopb2bfih2.png" alt="API Gateway in the console."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk82c5lobn7f8672ymo5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk82c5lobn7f8672ymo5.png" alt="After cdk deploy, you can get API Gateway URL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;As you can see with not much code we built/deployed and exposed a serverless API.&lt;/p&gt;

&lt;p&gt;You can check the full repo &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and use this as an example to start building a more complex logic in your API.&lt;br&gt;&lt;br&gt;
It is also super easy to manage more than 1 lambda function in your stack, you just have to call multiple time the CDK functions so enjoy ✌️&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/thomaspoignant" rel="noopener noreferrer"&gt;
        thomaspoignant
      &lt;/a&gt; / &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;
        cdk-golang-lambda-deployment
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;cdk-golang-lambda-deployment&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;This repo is an example on how to deploy a serverless API on AWS Lambda using aws CDK.&lt;/p&gt;
&lt;p&gt;Associated article &lt;a href="https://faun.pub/golang-build-and-deploy-an-aws-lambda-using-cdk-b484fe99304b" rel="nofollow noopener noreferrer"&gt;https://faun.pub/golang-build-and-deploy-an-aws-lambda-using-cdk-b484fe99304b&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Lambda&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;The GO Lambda function is a simple API using &lt;code&gt;go-chi/chi&lt;/code&gt; to handle http requests.&lt;br&gt;
The code is located in the &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment/lambda/api" rel="noopener noreferrer"&gt;&lt;code&gt;/lambda/api&lt;/code&gt;&lt;/a&gt; folder.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Deployment with CDK&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;The CDK stack is also simple, it build the binary of the lambda and deploy it with an API Gateway in front of this lambda to access it through HTTP.&lt;br&gt;
The code is located in the &lt;a href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment/infra-cdk" rel="noopener noreferrer"&gt;&lt;code&gt;/infra-cdk&lt;/code&gt;&lt;/a&gt; folder.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/thomaspoignant/cdk-golang-lambda-deployment" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>aws</category>
      <category>cdk</category>
      <category>go</category>
      <category>lambda</category>
    </item>
  </channel>
</rss>
