Contributing to aws-cdk-lib (part2). Building cdk

This follows up the previous diary notes, Contributing to aws-cdk-lib (part1). Where I built a development environment using code catalyst.

5 May, 8:20am.
Getting the dev environment going was pretty easy. Whats the chance that building cdk will be just as easy? That would be asking too much I think. Theres some hints about how to do this in aws-cdk/ at main · aws/aws-cdk (, and in fact some specific info for Code Catalyst.

Amazon CodeCatalyst Dev Environments
Dev Environments are cloud-based development environments. Amazon CodeCatalyst allows you to checkout your linked Github repositories in your Dev Environments with your favorite local IDEs such as VSCode or JetBrains.

Build up aws-cdk-lib as well as framework-integ when you enter your Dev Env:

$ yarn install
$ NODE_OPTIONS=--max-old-space-size=8192 npx lerna run build --scope=aws-cdk-lib --scope=@aws-cdk-testing/framework-integ
You may configure your Dev Env with the devfile.yaml to further customize your Dev Env for CDK development.

Read the links below for more details:

Dev Environments in CodeCatalyst
Using GitHub repositories in CodeCatalyst
Setting up to use the AWS CLI with CodeCatalyst

If it turns out to be that easy, i will have to send cheese scones to the cdk-team.

5 May 8:24am

This is pretty handy, while you can open Remote Dev environment from the web page, it appears that its its well integrated into VSCODE. Couple of clicks, got connected back to that environment we spun up yesterday.

So, follow the instructions? For once in my life i think i will.

[mde-user@ip-10-6-105-213 aws-cdk]$ yarn install
yarn install v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.22.19", while you're on "1.22.15".
info To upgrade, run the following command:
$ curl --compressed -o- -L | bash
Done in 41.43s.
[mde-user@ip-10-6-105-213 aws-cdk]$ 

That yarn upgrade is not a big deal

[mde-user@ip-10-6-105-213 aws-cdk]$ curl --compressed -o- -L | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    54  100    54    0     0    701      0 --:--:-- --:--:-- --:--:--   710
100  2341  100  2341    0     0  12191      0 --:--:-- --:--:-- --:--:-- 12191
Installing Yarn!
> 1.22.15 is already installed, Specified version: Redirecting to
> Downloading tarball...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    57  100    57    0     0   1232      0 --:--:-- --:--:-- --:--:--  1239
100    94  100    94    0     0    860      0 --:--:-- --:--:-- --:--:--   860
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1215k  100 1215k    0     0  2788k      0 --:--:-- --:--:-- --:--:-- 2788k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    61  100    61    0     0   2718      0 --:--:-- --:--:-- --:--:--  2772
100    98  100    98    0     0   2526      0 --:--:-- --:--:-- --:--:--  2526
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   833  100   833    0     0   2323      0 --:--:-- --:--:-- --:--:--  2323
> Verifying integrity...
gpg: keyring `/home/mde-user/.gnupg/secring.gpg' created
gpg: key 86E50310: public key "Yarn Packaging <>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: Signature made Tue 10 May 2022 07:48:23 PM UTC using RSA key ID 69475BAA
gpg: Good signature from "Yarn Packaging <>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
     Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
> GPG signature looks good
> Extracting to ~/.yarn...
> Adding to $PATH...
> We've added the following to your /home/mde-user/.bashrc
> If this isn't the profile of your current shell then please add the following to your correct profile:
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

> Successfully installed Yarn 1.22.19! Please open another terminal where the `yarn` command will now be available.
[mde-user@ip-10-6-105-213 aws-cdk]$ 

And just like it suggests, started another terminal and yarn has been upgraded.

[mde-user@ip-10-6-105-213 aws-cdk]$ yarn -v

Next bit. ( as per the instructions, how mundane, but so far, touch wood it works.

[mde-user@ip-10-6-105-213 aws-cdk]$ NODE_OPTIONS=--max-old-space-size=8192 npx lerna run build --scope=aws-cdk-lib --scope=@aws-cdk-testing/framework-integ

At this point, Im glad that i’ve got that machine with a bit more go, than the 2CPU. This process is going to take some time. , enough time to get a coffee, and answer some emails. I’m guessing it will work on the free machines, but it will take a bit longer I suppose. 12 minutes. Does code that you are watching take longer to build?

>  Lerna (powered by Nx)   Successfully ran target build for 2 projects and 18 tasks they depend on (12m)

That whinge about it not being instant however, Is somewhat forgotten when it dawns on me, that I’ve had a large project build, on a new dev environment, without error so far? really. When did that last happen?

At this point, i’m set up to do some actual work. actual effort to make this all work, about an hour. Lets see if i can make that happen soon.


One response to “Contributing to aws-cdk-lib (part2). Building cdk”

  1. […] follows part 2 in a series Contributing to aws-cdk-lib (part2). Building cdk – Cloud Networking as Code (cloud-networking-as-…. This is a set of diary entries than a blog, welcome along to my journey. I expect that we’ll […]

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.