Everything-as-Code: jumping into the space with AWS CDK
Photo by https://unsplash.com/@ivvndiaz

Everything-as-Code: jumping into the space with AWS CDK

Once there was a rejection from a well-known software consulting company in Helsinki, Finland. They said I need to focus either on software development or cloud infrastructure. It took me some time to find a unique path. The experience of deploying Java modules manually in the command line via VPN connection shaped my pursuit for serverless and infrastructure as code.

Now I am writing everything-as-code. It is the case where one could not consider implementation without the cloud resources needed for the business logic. DevOps movement already made the foundation with version control, automation, and close collaboration between teams. Everything-as-code is the next step where the developer controls the cloud with familiar tools and languages.

When I saw AWS Lambda for the first time, it was more of writing APIs for frontend people. It gave them superpowers. Now I think infrastructure as actual code is doing the same, but with all developers, no matter their level or stack. Here are my tips for getting into infrastructure as code using AWS. I would focus on CDK, a framework for describing your cloud resources using programming languages.

Shaping Mindset

The idea is to automate everything and make it repeatable. Revise the principles of DevOps. Find supporters among colleagues. Also, AWS recently started the Skill Builder portal. Here is a path for understanding DevOps. Here is the link.

Resource Planning

It should include a rough sketch of the resources you will need. Also, it would be helpful to understand what would be a custom construct (think about modules) and what would be a stack. One of the problems with the traditional YAML or JSON-based tools is conditional deployment. Sometimes, one does not need a custom domain setup in development or branch deployment. CDK gives the ability to generate the CloudFormation stack with the resources required for the deployment stage on the template level.

Languages

Know one of the supported languages. It looks like the documentation is good for TS and Python. Choose wisely. TypeScript could be better than JavaScript. It matters what language the team is using, of course. Unit testing, linter, and code documentation will give a consistent environment. There is a way to have a mono repository setup where all code sits simultaneously.

CloudFormation

Getting knowledge in CloudFormation is a must. It would help if you understood the anatomy and principles behind this service. In the end, CDK would transform all your code into CloudFormation. Experience with other IaC tools would be helpful. Terraform or serverless will work fine.

Bonus: Serverless case

Think about bundling your external dependencies beforehand (not node standard ones and not aws-SDK). Check constructs like 'cdk pipelines' and 'NodeJsFunction'. The first one helps with CI/CD. The second one bundles your code similar to webpack but faster.

These recommendations could start the journey into writing software without thinking only about cloud resources or business logic. The perception becomes whole because there is already no separation in the modern cloud-native world.

Thanks for reading this article! Feel free to connect if you want to share your ideas regarding AWS, Infrastructure as Code, CDK, Serverless, or cloud transformations.

Tuomo Varis

Senior Software Consultant at Asteroid

3 年

This! With serverless architectures the line between infrastructure and application code is already drawn in the sand and tools like CDK make this more manageable. Another very interesting development is projects like SST that build on top of CDK to provide more application-framework-like developer experience via high-level constructs.

要查看或添加评论,请登录

Igor Soroka的更多文章

  • Why do big corporations go serverless?

    Why do big corporations go serverless?

    'Big corporations will never build their applications using serverless.' - This was my way of thinking back in 2017…

  • When less AWS Lambda function code is better

    When less AWS Lambda function code is better

    In the complex business landscape, sometimes composing AWS Lambda functions with the mindset of doing one thing at a…

    2 条评论
  • Infrastructure provisioning for your next cloud project

    Infrastructure provisioning for your next cloud project

    Last week I traveled to Tampere for the great meetup about Serverless. My talk discussed the tools for the…

  • Storing your data without paying for server time

    Storing your data without paying for server time

    In this edition, we will be discussing the ways of storing the data in the serverless world. In traditional data…

  • Organising your workflow with serverless

    Organising your workflow with serverless

    Last week I attended AWS Summit Stockholm 2022 held on May 11. It was an incredible and inspirational event where I met…

    2 条评论
  • Why should your product go Serverless?

    Why should your product go Serverless?

    Nowadays, people are writing software in countless ways. They have various backgrounds and skillsets with tastes.

  • Making APIs faster using serverless

    Making APIs faster using serverless

    How does your application communicate with the backend? Probably, it will talk through an API. It will support reading…

  • Collaboration in serverless development team

    Collaboration in serverless development team

    In this edition, I will continue talking about breaking the 'fat lambda' into microservices. One could read the…

  • Migration to Lambdas. What could go wrong?

    Migration to Lambdas. What could go wrong?

    Thanks for subscribing to the first edition here, where I have talked about Terraform and CloudFormation. Today we will…

  • Why should you use CloudFormation tools?

    Why should you use CloudFormation tools?

    Sometimes it is worth sharing the thoughts longer than posts and shorter than blogs. Today I have decided to start the…

    2 条评论

社区洞察

其他会员也浏览了