Contributing to aws-cdk. Part3 L2 Lattice Constructs.

This follows part 2 in a series Contributing to aws-cdk-lib (part2). Building cdk – Cloud Networking as Code (cloud-networking-as-code.com). This is a set of diary entries than a blog, welcome along to my journey. I expect that we’ll be slowing down from here, as there is quite a bit of learning to do, and interactions with lots of people. So I’m expecting that i’ll be updating this over the next weeks.

Sunday May 7, Some time after lunch.
What is going to be a good candidate for this? cdk-hello-world, is going to be boring, and probably won’t get accepted. There is a whole bunch of real problems to solve for customers, but they are all time pressured, so complicating it with an unknown process is not going to be a great idea. Lattice is something I’m intrigued by. It appears to be mostly supported by CloudFormation as well. @netdevautomate is interested in this, and so are a few others, so probably will get some help. So Lattice, lets cdk ya.

Even after hanging around for quite some time with cdk, its not been immediately obvious how to get started. There were some mentions about an RFC process in the contributing guide.

“If the changes are significant or intrusive to the existing CDK experience, and especially for a brand new L2 construct implementation, please write an RFC in our RFC repository before jumping into the code base. L2 construct implementation pull requests will not be reviewed without linking an approved RFC.”

Ok, that’s pretty explicit, I’ll need to create a RFC. I need to figure out what the RFC process looks like and how to write one. There is a git repo for this, and the starting point is to write an RFC!

Sunday May 7, 5:36PM.

Knocked out a RFC by submitting an issue to https://github.com/aws/aws-cdk-rfcs. It might not be that good, but we’ll see.

Now to see if we get a bar raiser

Thursday 11 May. 8:27pm

The starting point is not the RFC. The starting point is to raise an issue, to track an RFC


So, it turns out that what i submitted was not the RFC, but just an issue to track an RFC and the eventual L2 constructs through their life into the project. So, if it seemed like it was light weight, it was, but that’s ok. Made contact with one of the aws-cdk team, via the slack channel on cdk.dev. Turns out that this was on the radar already, and you’ll never guess what happen. Andy Taylor had already been looking at this. Well, Andys a good guy and short story long. we’ll work together on this.

We’ve got a bar raiser now.. Seems we have traction. Still definitely a lot of things to figure out. We need to have a kick off meeting, which is going to be fun, across +12GMT, GMT, and Pacific Time. Guess I’ll be up for a chime call at 3:30am.

Once we’ve done that, we’ll write the RFC, and submit a PR, circulate it for comment, community input all that stuff.

In the meantime i’ve been messing with some code. Code Catalyst is working well. And Code Whisper keeps surprising me at how good it is at providing the right code at the right moment. It does a really good job, when you’ve got a bit of code already. Its a wee bit freaky.

https://github.com/raindancers/latticeplay

17 May: Progress. After a lot of reading, and lot of experimentation Ive made progress.

another. is a LOT of information in here; You really need to read these documents carefully.

CONTRIBUTING.md.
AWS Construct Library Design Guidelines

When I carefully read it again, I saw a link to an *example-construct-library* in the aws-cdk git-repo. This looked promising.
Looking in the package.json, a little gem of information glimmered!

“description”: “An example CDK Construct Library that can serve as a template for creating new libraries.

Would it be possible to just copy this library, modify a few things, and start my project?

Sparing the details and mistakes, heres the play, to create a alpha package for ‘reddog’. ( this is totally made up, and if AWS is working on a service called reddog, that is totally coincidental).

Essentially, I’ve copied the example-construct library to a new directory, edited the package.json file, with some new names, yarn install, yarn build. ( Remember i’ve already done the build of the entire aws-cdk-lib, if you dont’ do that, this won’t work )

[mde-user@ip-10-6-115-24 aws-cdk]$ cp -R ./packages/@aws-cdk/example-construct-library/ ./packages/@aws-cdk/aws-reddog-alpha

[mde-user@ip-10-6-115-24 aws-cdk]$ cd ./packages/@aws-cdk/aws-reddog-alpha

edit package.json keys


"name":  "@aws-cdk/aws-reddog-alpha"
"repository": "packages/@aws-cdk/aws-reddog-alpha",
"jssi": {
   "targets": {
      "java": {
        "package": "software.amazon.awscdk.services.reddog.alpha",
        "maven": {
          "groupId": "software.amazon.awscdk",
          "artifactId": "reddog-alpha"
        }
      },
      "dotnet": {
        "namespace": "Amazon.CDK.AWS.Reddog.Alpha",
        "packageId": "Amazon.CDK.AWS.Reddog.Alpha",
        "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/main/logo/default-256-dark.png"
      },
      "python": {
        "distName": "aws-cdk.aws-reddog-alpha",
        "module": "aws_cdk.aws_reddog_alpha",
        "classifiers": [
          "Framework :: AWS CDK",
          "Framework :: AWS CDK :: 2"
        ]
      }
    }
      
 
yarn install
NODE_OPTIONS=--max-old-space-size=8192 yarn build

edit README.md

It built and just built my ‘reddog’! With all the tool chains, linters and various bits and pieces in place. And it works. And I can move on. However its left me wondering.. Is this the way the aws cdk team do it? Lets ask and see what we get

https://github.com/aws/aws-cdk/discussions/25636

Rinse and Repeat, for aws-vpclattice-alpha.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.