The Ops Community ⚙️

Cover image for Tidy Cloud AWS issue #23 - CDK Day, Terraform refactoring
Erik Lundevall Zara
Erik Lundevall Zara

Posted on • Updated on • Originally published at cloudgnosis.org

Tidy Cloud AWS issue #23 - CDK Day, Terraform refactoring

Hello all!

Welcome to the next issue of the Tidy Cloud AWS bulletin!

This issue of the bulletin talks about CDK Day, some Terraform tips and an interesting article around concurrency for a few serverless compute services from AWS.

Enjoy!


CDK Day 2022

Last week, on May 26th, the CDK Day 2022 event happened. It is a community-driven event, organized by several Cloud Development Kit (CDK) enthusiasts. It has grown in size every year, and this year it spanned around 5 hours of talks, with three parallel tracks.

Worth noting is that participation from AWS themselves was significantly higher this year than in previous years. There were both people from the AWS CDK team, and from other parts of the AWS organization.

There were about 14:ish hours’ worth of talks, most of them 20-30 minutes each.

CDK consists essentially of four different frameworks/library solutions, which all were covered:

  • AWS CDK - infrastructure-as-code using programming languages for AWS Cloud infrastructure, generating CloudFormation under the hood

  • CDK for Terraform - infrastructure-as-code using programming languages, generating Terraform under the hood. Thus also supporting all platforms that Terraform supports.

  • CDK8s - configuration-as-code for Kubernetes. Generate Kubernetes YAML-configurations using programming languages.

  • Projen - software-project-setup-as-code - setting up and maintain software projects using programming languages

In the keynote Rico Huijbers from the AWS CDK team, he talked a bit about the roadmap ahead and ongoing work to accommodate more types of organisational workflows. He also mentioned that Go language support is now generally available, and that AWS CDK v1 goes into maintenance mode on June 1st 2022 - only critical security patches and such will apply to 1.x from now on, all feature updates will be for v2.x.

AWS CDK without CloudFormation

Readers of this bulletin may remember that I mentioned in issue 21 that Pulumi released support to use AWS CDK constructs with Pulumi. One of the sessions on CDK Day was a presentation from some folks at Pulumi showing and talking about this feature.

I think Pulumi has a pretty good story in terms of interoperability with other tools, including Terraform and CloudFormation, besides covering many cloud providers.

Under the hood, Pulumi’s CDK support takes the generated CloudFormation and translates that to their own AWS native interface, which uses AWS Cloud Control API. So it is fine to mix Pulumi-native resources with CDK-derived resources. AWS Cloud Control APIs do not have 100% resource coverage. In these cases, specific resources need to be remapped through their older AWS provider. Recently Pulumi posted a video about using AWS CDK, where this remapping was covered

Hybrid constructs

Another interesting talk included a concept of hybrid constructs in CDK for Terraform (CDKTF). This is an approach to package modules for re-use both as traditional Terraform modules, for those that prefer to use Terraform HCL language, and CDKTF constructs or packages. In this way, the same solutions can be used both by those who prefer to use the more declarative syntax of HCL, and those who prefer programming language interfaces.

I think this is an immaculate concept. Pulumi has a somewhat similar idea with their Pulumi YAML support, where you can configure resources using YAML syntax instead of programming languages.

There is not quite that for CloudFormation and CDK yet, although you can map CloudFormation modules in AWS CDK to some extent and there is the decdk app, which is a kind of extension to CloudFormation where you can include AWS CDK constructs as well.

Anyway, I think this is an interesting space. There is much value in providing usable interfaces for multiple groups of people.

Other topics

There were many topics on these CDK-type frameworks, both in terms of people describing how they use them, with tips and tricks, sharing experiences. All the content is recorded and is available on YouTube, one recording per track. Since each recording is over 5 hours, you probably want to cherry-pick the sessions you want to watch. For track 1 and track 3, there are content lists in the comments, with timings for the start of each of the sessions.

Terraform - useful advice

I have been working a bit more on Terraform lately, and mostly I enjoy it. This has also led to that my collection of Terraform-related videos have grown a bit to refresh my knowledge a bit.

The blog post Some Techniques to Enhance Your Terraform Proficiency is just what it says, some good tips and tricks to make your use of Terraform better.

There is a lot of Terraform material on YouTube as well. Some channels that may be of interest here are:

Serverless concurrency explained

Nathan Peck, which works at AWS with container solutions, wrote a nice article where he compares three of the services that AWS provides to run serverless solutions:

  • AWS Lambda

  • AWS AppRunner

  • AWS ECS

https://nathanpeck.com/concurrency-compared-lambda-fargate-app-runner/

It is a good comparison and I think useful to have in mind when selecting an approach to run workloads serverless.


You can find the contents of this bulletin and older ones, and more at Tidy Cloud AWS. You will also find other useful articles around AWS automation and infrastructure-as-software.

Until next time,

/Erik

Top comments (0)