logo

AWS Exam GuidesNewsletterBlogContact

👋 Hey! My name is Wojciech Gawroński, but others call me AWS Maniac.

My goal is to safely guide you through the cloudy and foggy space of the AWS portfolio.

Introducing AWS Solutions Constructs

2 min read, last updated on 2020-12-22

Finally! I think this is an exciting announcement, especially since the community prepared something like this earlier (cdk-patterns). I do not have anything against a community-driven version, but it should be the creator’s responsibility to provide an initial release for it.

Let’s investigate what it is and what it gives.

What are AWS Solutions Constructs?

AWS Solutions Constructs (Constructs) is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions in code to create predictable and repeatable infrastructure. The goal is to accelerate developers’ experience to build solutions of any size using pattern-based definitions for their architecture.

Definition from the official documentation.

In other words: it’s the way to create architecture in an opinionated way with the use of AWS best practices. It is also an excellent presentation of the AWS CDK capabilities (mostly reusability and modularity) and a model example of how it can work.

Here, you can browse the full catalog of AWS Solutions Constructs patterns. Additionally, you can review the available examples in the form of the use cases that contain a complete and working implementation of a given problem (e.g., AWS Static S3 Website).

Example use cases for AWS Solutions Constructs available in the library.

So how can we add those to our projects? We need to add a dependency, and use it as a typical CDK construct:

const { LambdaToS3 } =
  require("@aws-solutions-constructs/aws-lambda-s3");

new LambdaToS3(stack, "LambdaToS3Pattern", {
  lambdaFunctionProps: {
    runtime: lambda.Runtime.NODEJS_10_X,
    handler: "index.handler",
    code: lambda.Code.asset(`${__dirname}/lambda`)
  }
});

Pitfalls

At the moment there a few problems with the library:

  • AWS Solutions Constructs is supported on AWS CDK1.46.0.
  • It supports TypeScript, JavaScript, Python, and Java at this time - so no .NET.
  • Each construct is marked as experimental when it comes to stability. So probably it will evolve, and potential updates may introduce breaking changes.
    • I’d suggest pinning to a particular version, but it may propagate to a problem with AWS CDK versioning, as main can be in a higher version than solution construct, and we may face difficulties.

What’s next?

I think the first step should be to stabilize a few, the most popular solutions. It is a recent addition to the CDK (22nd of June 2002), so we need to be patient.

Nevertheless, that’s something that I expected and wanted. This is a significant improvement in adopting AWS CDK and something that I missed in the AWS CloudFormation space (I do not count the plethora of sparse, official/unofficial templates here and there).

Subscribe to the newsletter and get notifications about new posts.

Subscribe

👋 Hey! My name is Wojciech Gawroński, but some people call me AWS Maniac. I am your trusted guide through the AWS Madness. If you want to learn more about me, you can start here.

Share it:

YouTube, Twitter, LinkedIn, Instagram, Facebook
awsmaniac.com © 2021, built with Gatsby and template from @kjendrzyca