Latest / AI Infrastructure / Why do we need the Cloud Development Kit?
Transcript
- 0:01Welcome to episode 12 of the AI
- 0:03Infrastructure Podcast with me, Kai
- 0:06Hendry in the UK and Vincent Smith over
- 0:10in Vietnam. In this episode, we talk
- 0:13about CDKTF.
- 0:15And long story short, we try to
- 0:17rationalize where CDKTF fits in in light
- 0:21of the recent deprecation by Hashi Corp/
- 0:23IBM.
- 0:26And
- 0:28we we do justify CDK. Uh well, let me
- 0:31give you a summary why we think CDK is
- 0:34important.
- 0:36It's a high level abstraction
- 0:39and it allows complicated cloud
- 0:42infrastructure to be reasoned about.
- 0:48It allows you to get the most out of the
- 0:50cloud to differentiate.
- 0:53And if you just think conversely perhaps
- 0:56if you got if you vibe coded your
- 0:59infrastructure using I don't know AWS
- 1:01CLI or something you just couldn't get
- 1:04uh
- 1:06a solid reproducible deterministic
- 1:10infrastructure that way you need higher
- 1:12level constructs uh that the AWS CDK
- 1:15sort of provide you. So
- 1:21you ideally need to work with it. So in
- 1:23light of the deprecation of of IBM that
- 1:26we need to find a place for for CDK a
- 1:30programming language in order to do the
- 1:33next level stuff with the cloud and
- 1:35infrastructure. So enjoy the episode.
- 1:38Please uh
- 1:41if if CDKTF doesn't uh tickle your
- 1:44fancy, check out the other stuff in the
- 1:46playlist and have a merry Christmas. See
- 1:50you. Goodbye.
- 1:52Yeah, this guy. Which which guy?
- 1:55>> So, since CDKTF was sunset by IBM and I
- 1:59created a fork under a project that I
- 2:02built a bunch of CDKF
- 2:04L2 constructs. There's one guy who's
- 2:07been contributing three PRs over
- 2:11well so far he's contributed I think
- 2:14seven PRs already and I merged six and
- 2:17he keeps adding cool stuff. It's
- 2:19amazing.
- 2:20>> Yeah. So you just forked it and and
- 2:22>> No, no, no. He contributes.
- 2:24[clears throat]
- 2:24So the one that I forked, I put it on
- 2:27pause, right? We're waiting for a go-
- 2:29ahead. Um we're collaborating with the
- 2:32Open Construct Foundation which um hosts
- 2:36several of the
- 2:38you know CDK related projects and we're
- 2:41trying to find a final and good name. Um
- 2:45hopefully we don't have to rename but I
- 2:47sincere I seriously doubt that Hashi
- 2:50Corp is going to allow us to use the
- 2:52original CDKTF package names. So we'll
- 2:55probably have to rename it. And I
- 2:57renamed the TCON which is Terra
- 2:59Constructs. It's a four-letter acronym
- 3:02and people obviously don't like that.
- 3:04TCON sounds familiar now. [snorts]
- 3:07>> Yeah. Terra Constructs is the library
- 3:08that I built.
- 3:09>> Oh okay.
- 3:11>> Yeah. So tons is is what I you know it's
- 3:13a scope that I have on npmgs. So I use
- 3:16it for a lot of stuff. So I was like,
- 3:17"Yeah, I'm just going to reuse I just
- 3:19took immediate action, right? Fork it
- 3:21and rename it to my stuff and then
- 3:24[snorts]
- 3:25>> then um
- 3:27>> yeah, so it it pushed my project in the
- 3:30foreground and we're holding on the fork
- 3:32because we don't have the final name and
- 3:34I agree maybe we don't call it TCON, but
- 3:37at the same time somebody else took
- 3:38notice of my other project and has
- 3:40contributed about eight PRs to it and
- 3:44they are all high quality.
- 3:46>> Can you show me? Can you get give me a
- 3:47link? I just I'm just curious to see
- 3:48what what what what you what what this
- 3:51contribution is. [snorts]
- 3:52>> Yeah. Uh
- 3:57it's on my
- 3:59here.
- 4:04I have to get used to this um thing
- 4:08jumping around. Hold on.
- 4:10>> But you mean your Arch Linux C?
- 4:13>> Yeah, I use I use Arch by the way.
- 4:18It's never going to get old. Going to
- 4:20keep saying it. Okay. I send it on Zoom.
- 4:24>> Yeah. Like Primagin says a lot. Does he?
- 4:27>> Does he just We're just following other
- 4:30YouTubers. So sad.
- 4:33[snorts] Uh
- 4:34>> no. But then then I have to start
- 4:35whining like Teo.
- 4:38>> Shots fired.
- 4:41>> I'm already doing a job whining. Right.
- 4:44One complaint that I get from my YouTube
- 4:46channel is that like, Kai, yeah, I like
- 4:49your content, but you you you complain
- 4:51too much, so I can't watch you. It's
- 4:53like, what do I am I that guy?
- 4:59Uh,
- 5:02okay. Refactor, use AWS CDK. Oh, hold
- 5:05on. Let me see if I can sh my screen.
- 5:09I've been digging into that PR because
- 5:11it actually enables really cool stuff.
- 5:16So basically a little bit of background.
- 5:19AWS CDK has this regional information
- 5:24library
- 5:26that keeps it track of like which
- 5:28capabilities are available across the
- 5:30regions. They download a fact table like
- 5:34uh lambda runtime support for NodeJS
- 5:38latest is version 22 in China or
- 5:40government region for example but it's
- 5:42version 24 for other regions where
- 5:45NodeJS version 24 has already been
- 5:47deployed right it takes time for this
- 5:48stuff to deploy
- 5:50>> so [clears throat]
- 5:51other stuff is like uh S3 bucket
- 5:55endpoints or like the domain suffix of
- 5:58an S3 uh original endpoint point, right?
- 6:01The URL suffix that um they changed the
- 6:04way that that S3 works over the years.
- 6:07So new regions, they use a different
- 6:09suffix.
- 6:10>> So the you know, I think I noticed that.
- 6:13>> Yeah. So the AWS CDK has logic in it
- 6:16that uses a fact table about the regions
- 6:18to figure out how to build a a bucket or
- 6:22like if you give it a a bucket URL or
- 6:25just a bucket name and and it's it has a
- 6:27it has a regional like your AWS CDK
- 6:30stack has a region. So then it uses that
- 6:32information to find out yeah what's
- 6:34going to be the domain URL for that
- 6:36bucket depending on the region. So I had
- 6:38copied that over. I had copied over the
- 6:40fact table into my code because I didn't
- 6:42know it was a separate package. And he
- 6:44says, "Well, you know, we don't have to
- 6:46copy over the details. We can just reuse
- 6:48the AWS CDK package on top of CDKTF."
- 6:51>> Cool. This actually looks like a pretty
- 6:52good contribution. Holy moly. I'm I'm
- 6:54>> Oh yeah, dude. All of his contributions
- 6:56have been absolute fire. The only thing
- 6:58is he doesn't write integration tests.
- 7:00So every single one of them I I check
- 7:01out and I um I I build an integration
- 7:04test and I validate that you can
- 7:05actually terraform deploy it into AWS
- 7:08and doesn't get any errors. Yeah. But
- 7:11he's been he's been aligning Terra
- 7:12constructs closely to AWS CDK.
- 7:15>> Cool.
- 7:17So I got a couple of maybe noob
- 7:20questions for you but like I guess this
- 7:23might serve the audience.
- 7:26So
- 7:27CDK for Terraform
- 7:30basically allow people to write in that
- 7:33familiar CDK style which was
- 7:37which was like which came out of
- 7:40>> AWS
- 7:41>> AWS uh what's his name? Ben Ben Israel
- 7:44right that guy
- 7:46>> not Ben Israel
- 7:48>> um who was it again?
- 7:52Is it worth mentioning her name?
- 7:55Who? What? Sorry.
- 7:56>> Who who who was the guy that was in the
- 7:59original team that he left and he he did
- 8:02did Wing Wing Lang?
- 8:04>> Yeah. Elot Ben Israel. Uh Elot Ben
- 8:07Israel.
- 8:08>> Oh, I I wasn't wrong with the name.
- 8:10Okay. Sorry.
- 8:10>> Yeah. Yeah.
- 8:11>> I thought I was making up the his name
- 8:13or something. So, CDK
- 8:18cool beans. I think we went through
- 8:20yesterday that it was like the the thing
- 8:23that really makes it different is that
- 8:25is that it's operationally
- 8:29uh friendly. You can refactor this the
- 8:31stuff
- 8:33and it's a programming language un
- 8:35unlike maybe Terraform and things like
- 8:37that. Now the thing that I don't
- 8:40understand is how it links up with
- 8:44Terraform. A and B
- 8:48what did actually CDK for Terraform
- 8:51actually provide? Did they provide
- 8:53everything that that uh Terraform
- 8:56providers did or was it a subset?
- 9:00Okay. So
- 9:03the cloud development toolkit CDK from
- 9:07AWS com is built upon and they've split
- 9:11this out like some composible
- 9:14um ideas. So one of them is the concept
- 9:18of constructs. Constructs are basically
- 9:21objects that
- 9:24know how to synthesize or write themsel
- 9:27out into like a small little snippet of
- 9:29configuration,
- 9:30>> right? If you use if you use a con and
- 9:33they are able to be composed into trees
- 9:35of constructs so you can nest constructs
- 9:37into other constructs and so
- 9:41>> yeah don't people sometimes call them
- 9:45>> oh is my webcam just stopped don't don't
- 9:48some people call them like stages or
- 9:50something like that
- 9:51>> no stages is something else I think it's
- 9:54um if you are doing like cloud for
- 9:58deployment across different
- 10:01environments. I think you can define
- 10:03stages,
- 10:04>> okay,
- 10:05>> to like duplicate stacks. I I mean I I
- 10:08know that CDK pipelines uses stages. I
- 10:10know that there's a concept of stages
- 10:11within AWS CDK, but the thing is
- 10:15first AWS CDK was built within AWS.
- 10:19Right.
- 10:19>> Right.
- 10:20>> They had a couple of crucial innovations
- 10:23in terms of infrastructure as code. The
- 10:25first one is a tree,
- 10:29a composition of configuration that
- 10:31starts at the root note which is usually
- 10:33your app, your entry point and from
- 10:36there on you tie like a tree of
- 10:38constructs and when you and each one of
- 10:41them have a little bit of configuration
- 10:44like information so they know how to
- 10:47synthesize out into a configuration
- 10:50target language. So if you use AWS CDK,
- 10:54the constructs that you need are the
- 10:56app, the AWS CDK app,
- 10:59>> that synthesizes itself down to a cloud
- 11:01for stack,
- 11:02>> right?
- 11:03>> And then each construct that you put
- 11:04inside those apps
- 11:06um will be a cloud for resource, right?
- 11:10Because within a stack you use cloud
- 11:12form resources, right?
- 11:13>> Right.
- 11:13>> And now if you apply those ideas on top
- 11:15of Terraform,
- 11:16>> right? So when when they port over the
- 11:19the app, it's basically something that
- 11:21represents a single terraform
- 11:24uh root module, right? If you talk about
- 11:26terraform modu um nomenclature or or
- 11:30concepts
- 11:31>> terminologies.
- 11:32>> Yeah. Yeah. If you if you basically have
- 11:34a directory and you drop in a config
- 11:36file and then you run Terraform in it,
- 11:38it will consider that directory as the
- 11:41root module, right? And then if you
- 11:43create another directory and you put in
- 11:45some config there and then you include
- 11:47that directory as a module that will be
- 11:49like a sub module right. So in terapform
- 11:52constructs are kind of like directories
- 11:54of configuration files and you you um
- 11:57source them into like module source and
- 12:00then you can nest those modules as well.
- 12:02But the one that is the actual um
- 12:07you know app entry point is the root
- 12:09module of your directory. Right? When
- 12:11terraform runs, it will find the
- 12:13terapform configurations in your
- 12:15directly sibling files and aggregate
- 12:17everything into a single config in
- 12:20memory, right? Both HCL, which is a
- 12:22separate set of JSON and some JSON if
- 12:23you want. And then it will create in
- 12:25memory your Terraform configuration.
- 12:28And then within that root module, you
- 12:30may refer to other modules that are
- 12:32coming from either
- 12:34>> it does it write it out as normal
- 12:35Terraform. So you can inspect the
- 12:37Terraform.
- 12:38>> Yeah. So the the whole greatness of CDK
- 12:41for Terraform is that ultimately what
- 12:44you get once you synthesize or serialize
- 12:50that construct tree down to the target
- 12:52language you get pure and raw Terraform
- 12:58>> and is is it is it readable or is it
- 13:01like
- 13:02>> it is
- 13:04>> nonsense?
- 13:05>> It's very readable. Uh there's a couple
- 13:08of things that may you know make people
- 13:10upset because in the construct tree
- 13:15um the identity of a resource like if
- 13:17you write terraform you're going to say
- 13:19um AWS
- 13:22instance and then you give it a name
- 13:24like uh web and then you put in the
- 13:26config attributes such as VPC ID
- 13:29instance type imi like what's the image
- 13:32that needs to be provided right so the
- 13:34name right AWS instance And then you
- 13:37have the name web in when you serialize
- 13:41from from TypeScript down into that
- 13:43config.
- 13:44>> Yeah.
- 13:45>> Kind of flattens everything. So it it
- 13:47does some type of unique ID generation.
- 13:49>> That's a good thing though. I thought we
- 13:50we we discussed that.
- 13:52>> No, it it's it creates an unique logical
- 13:55ID. So that resource it's not your
- 13:57physical ID because in in any case when
- 13:58you create an instance in AWS your
- 14:00physical ID is you cannot determine it
- 14:02either, right? Not all AWS resources
- 14:04allow you to determine your physical ID.
- 14:07The instance ID is I- blah blah blah
- 14:09blah. Your your load balancer ID is I is
- 14:12LB- something. But if you do a bucket
- 14:14and you say I want the bucket name to be
- 14:16FU, it will be exactly FU and globally
- 14:18unique. You will not get it even if
- 14:20somebody else created a bucket fu.
- 14:21Right? [snorts]
- 14:22>> Um so so some resources they allow you
- 14:25to determine or to define your physical
- 14:27ID and some [snorts] resources they
- 14:30don't allow you and they automatically
- 14:31get an ID. But here I'm talking about
- 14:33the logical ID, right? Even though the
- 14:36logical ID will be something that you
- 14:37write in your configuration file. So if
- 14:39you ask me like does it serialize to to
- 14:42readable terraform, it is just the logic
- 14:47ids have these weird suffixes that you
- 14:49can actually disable if you want. You
- 14:50can actually go and say don't give me
- 14:52these hash suffixes, but they're used to
- 14:54make things unique. They're used to make
- 14:57sure that the logic IDs don't have any
- 14:58conflicts. So, [snorts] so that's the
- 15:01only thing that I think people when they
- 15:02first look at it kind of get annoyed by
- 15:04is like why are these names so like have
- 15:06this weird checksum like like you know
- 15:09this hash at the end of the name. Uh and
- 15:12that's purely because they don't want to
- 15:13have a conflict or an error when you
- 15:15have like nested parts that all get
- 15:17serialized down into the root module.
- 15:19>> Um so CDKTF also supports modules
- 15:22Terraform modules by the way you can
- 15:24refer to an existing Terapform module.
- 15:25So it's very good for an existing team
- 15:28that is already using terapform modules
- 15:30extensively. With CDKTF, you can take
- 15:33that terapform module and convert it
- 15:35into a TypeScript interface. So it reads
- 15:38the full module definition, looks at all
- 15:40of the variables and their types
- 15:42>> and then creates an equivalent type.
- 15:44>> In my in my current client, we we we
- 15:48switched to Terra. They they were
- 15:50they're a CDK shop, but we but when I
- 15:53joined, we we basically set up a new
- 15:56workflow with Terraform because of
- 15:59Snowflake.
- 16:00But it sounds like I could have used
- 16:02CDKTF to bring in the Snowflake
- 16:06Terraform provider into into CDK world,
- 16:09right? Or to Am I misunderstanding?
- 16:13the CDKTF provider would allow you to if
- 16:18you so so that's one thing right you can
- 16:21create bindings for modules and it will
- 16:23look at the variables that the module
- 16:24take and then generate a typescript
- 16:26interface or you can create bindings to
- 16:28terapform providers like the so
- 16:30snowflake provider and yes you will get
- 16:33a TypeScript interface but no it will
- 16:35not allow you to to use it with AWS CDK
- 16:38right because AWS CDK only works with
- 16:40cloud form and the CDKTF generated one
- 16:43will generate terraform.
- 16:45>> Yeah. Yes. So, but it Yeah.
- 16:49I mean, to be honest, I'm not a huge fan
- 16:51of all the I mean, this this this magic
- 16:57converting different bindings of
- 16:59different languages into CDK kind of
- 17:00makes me nervous.
- 17:01>> I I want to clarify one thing, right? in
- 17:04itself
- 17:06creating a terapform provider I mean
- 17:08reading in the terraform provider
- 17:09resources and generating TypeScript
- 17:11bindings or Python orn net or whatever
- 17:14on its own has very little value
- 17:16honestly um you just get these like L1
- 17:20constructs and you now can call that
- 17:25constructor and maybe the one thing that
- 17:27you get is you're able to use like um
- 17:30lazy evaluations basically you And for
- 17:34some attributes, you can provide a
- 17:35function instead of an actual value. And
- 17:38so when it synthesizes, it's going to
- 17:40execute the function to basically decide
- 17:43what the value for that property needs
- 17:44to be. And that is very powerful
- 17:46already, right? Because it means that
- 17:48depending on how you call it, a function
- 17:50can execute and then determine what the
- 17:52value for this particular attribute
- 17:54could be. Um, for example, if you are
- 17:57where is this like really useful? Yeah,
- 17:59maybe in policies, right? Let's say that
- 18:02you you are you are building some type
- 18:04of infrastructure and you're using an IM
- 18:06policy and you're using a bunch of other
- 18:09resources and you want the policy to be
- 18:12generated at the very end after the user
- 18:14has already defined the full program and
- 18:16all of the configuration that he wants
- 18:18to be
- 18:18>> generated. Yeah, there's a lease
- 18:20privileges type thing. M
- 18:21>> yeah the functions can be very smart and
- 18:24identify exactly what are the actions
- 18:27that need to be added into the policy
- 18:29depending on what the user um you know
- 18:33connected. So it's kind of like it's
- 18:35kind of a mixture of like an imperative
- 18:37language to create a declarative
- 18:39definition of infrastructure as code and
- 18:41like people are like oh you know why
- 18:42would you do that you know is all about
- 18:44declarative and you you cannot do mix it
- 18:47with imperative you start doing that
- 18:49people will no longer like know exactly
- 18:51what's going on uh but if you look at
- 18:54the language itself since uh terraform
- 18:560.12
- 18:58you know before it became uh stable they
- 19:01added um list comprehensions they added
- 19:05dynamic values dynamic you know for each
- 19:08and there's a very clear reason why they
- 19:10did that because you can't manage AWS
- 19:13resources with pure static definitions
- 19:16you're always before that you have free
- 19:18processors people wrote template
- 19:20languages to generate terapform
- 19:21configuration
- 19:22>> yeah yeah I feel I feel this is a trend
- 19:24in infrastructures co in infrastructure
- 19:27game is like
- 19:29the days have gone where you can just
- 19:31declaratively put thing is in YAML,
- 19:34right? You you need
- 19:35>> you need a programming language and then
- 19:37>> you're going to keep adding layers and
- 19:39layers of abstraction to work around
- 19:40this this core missing feature that you
- 19:44are not working with a proper language
- 19:45programming language and then you start
- 19:47adding um config language.
- 19:49>> Yeah. So generators
- 19:51>> I guess in a in a very
- 19:54uh succinct way CDK gives you the binds
- 19:59to a proper programming language and
- 20:01that's that's really what what it does
- 20:03right [clears throat]
- 20:05>> and but still I mean and then and then
- 20:07it gives you the ability to do lazy
- 20:08evaluations so late binding um so that
- 20:11you can evaluate the full full program
- 20:14and the user can program uh imperatively
- 20:16build up the the configuration so he can
- 20:19take some object that somebody else
- 20:21wrote and then invoke some methods on it
- 20:24to mutate this, you know, the the the
- 20:27object to their liking.
- 20:28>> Like for example, in in CDK for
- 20:30Kubernetes, um when you create a
- 20:33deployment, it's going to define a pot
- 20:35template and then a replica uh count
- 20:38that how many times you want that
- 20:39template to be created um to create the
- 20:42pots, right? And and then you want maybe
- 20:44to set some type of anti-affffinity. So
- 20:47you can do all of that declaratively in
- 20:49in Kubernetes and it's not a simple
- 20:51configuration system because to define a
- 20:53pot template with anti- affinity rules
- 20:56um to be fully flexible and this is also
- 20:58why people like compose right compose is
- 21:00super simple but like Kubernetes has all
- 21:02the little dials and knobs.
- 21:05>> Sorry what's compose oh with a K. You
- 21:07mean
- 21:07>> docker compose um you know before that
- 21:09or ECS people like
- 21:11>> oh docker compose oh okay
- 21:13>> yeah I love docker compose because it
- 21:16gives you like this very simple thing
- 21:18but if you want to do something earlier
- 21:20you were complaining um yesterday you
- 21:22were complaining you were saying
- 21:23verscell is great but if you want to do
- 21:25like um custom type of database I can't
- 21:28do it you know I need the dials and
- 21:30knobs well that's where it breaks right
- 21:32these abstractions so the same way way
- 21:34with compose and and and that's why
- 21:36kubernetes as like everything under the
- 21:37sun, right? You can define exactly what
- 21:39resources on the node need to be
- 21:41>> for days and crossplane.
- 21:43>> Yes. And and and and so the actual
- 21:46configuration you have to write becomes
- 21:47super complicated. Kubernetes is the
- 21:49same thing. You end up with like
- 21:52>> what is the Yeah. So I got CDK is the
- 21:55programming language answer to maybe uh
- 21:59Terraform. But what is what is the
- 22:01programming language answer to to
- 22:04you know Kubernetes?
- 22:06So AWS built CDK for Kubernetes. There's
- 22:09one guy Ilia, he did a lot of like he's
- 22:12one of the main contributors.
- 22:14Yeah, I loved it. Like initially it was
- 22:16a bit frustrating because you
- 22:18>> Yeah, because one of the things you
- 22:20learn as a Kubernetes administrator and
- 22:22if you go for certificates, which I
- 22:23never do because I don't think they're
- 22:24worth it. Um,
- 22:26>> oh dear God, don't go there. That's a
- 22:28rabbit hole.
- 22:29>> Yeah. So
- 22:29>> is this another Ben Israel thing? Um,
- 22:33no, but it comes from within AWS, but it
- 22:36applies the same idea of of creating a
- 22:38tree of constructs and and and the same
- 22:41idea of building like the core
- 22:43Kubernetes API objects which are pod
- 22:46deployment, replica set, um, service and
- 22:50all of these, right? And now he's doing
- 22:53robotics.
- 22:55>> Anyway, so Ilia is one of the guys that
- 22:58like I see contribute and react and
- 23:00still maintain this project mostly. I'm
- 23:01sure there's other people working on it.
- 23:03But the greatest thing here is
- 23:05>> the moment you have built those core API
- 23:07objects, you can still write this, you
- 23:10know, create your Kubernetes
- 23:12configuration, but it's honestly worse
- 23:15worse than YAML because you have all
- 23:17these additional curly braces and very
- 23:19nested like complicated configuration.
- 23:21So pure L1 constructs, this pure
- 23:24language binding are not very useful.
- 23:27But what's immensely useful when you
- 23:30work with CDK for Kubernetes is that
- 23:32they built these higher level ideas of
- 23:36like we're going to grab this low-level
- 23:38API object that's called a deployment
- 23:40and we're going to add a scheduling
- 23:42namespace and we're going to add the
- 23:45idea of spreading pods on the scheduling
- 23:48namespace and suddenly you are defining
- 23:50like I want to spread this across nodes
- 23:53and there you basically you go like my
- 23:55deployment.spread spread dot uh sorry my
- 23:58deployment.sccheduling.spread
- 24:00spread as a method. Your intention is to
- 24:03spread these pots. That's your
- 24:05intention, right? And that gets
- 24:07translated into a declaration, an actual
- 24:10rule.
- 24:11>> Yeah. So,
- 24:13>> the affinity
- 24:14>> these convenient Yeah, that sounds like
- 24:16a good useful abstraction.
- 24:18>> Plus,
- 24:19>> so what what abstractions?
- 24:21>> Oh, plus, sorry. Yeah, plus is is the
- 24:24the the the real power because that's
- 24:26where they they create these high level
- 24:28like deployment and chron job and and
- 24:31then you and they make service and and
- 24:33then they have like reasonable defaults.
- 24:35So with very few lines of code it's kind
- 24:38of like Helm, right? But Helm is
- 24:41declarative like YAML config files with
- 24:43no schema. So you don't get
- 24:44IntelliSense. you don't know exactly
- 24:46like where do I need to put this
- 24:48configuration for it to end up where it
- 24:49needs to be because YAML helm doesn't
- 24:52have any schemas and even in later
- 24:54versions they try to add schemas but it
- 24:56doesn't really work.
- 24:56>> So have you have you used this
- 24:58production or you just checked it out?
- 25:00>> No I I I I
- 25:03was at an organization that had
- 25:04everything under the sun. They had helm
- 25:06they had JSONet they had customized they
- 25:08had
- 25:08>> Oh my god.
- 25:09>> Yeah. They had everything.
- 25:10>> And did you introduce something new
- 25:11while you were there? Of course, I I I
- 25:14built a new standard, but I [laughter]
- 25:15did more than that. I did not just add a
- 25:17new standard. I actually built a bunch
- 25:19of migration tools for everything else.
- 25:22So, I I had like a very clear path like
- 25:24if this is a service that you're working
- 25:26on and we we were adopting Argo CD and
- 25:28the only way to adopt Argo CD was to
- 25:30adopt CDK for Kubernetes. So, I made it
- 25:33so that you can't go and manage your
- 25:35service with Argo CD without
- 25:37>> I don't think we've ever really talked
- 25:38about GitOps. Are you a GitOps? I mean,
- 25:41do you have uh any opinions there
- 25:44quickly?
- 25:47>> Yes, I I
- 25:49>> maybe save that for another video.
- 25:52I [snorts] ran Argo CD since 2019
- 25:55and very quickly realized that a lot of
- 26:00people like to do magic on the server
- 26:03side and they like to minimize the
- 26:05configuration that goes in and then they
- 26:08like to Argo CD to like expand
- 26:10everything using Helm uh rendering like
- 26:13last minute.
- 26:14>> Oh no no no. You want Argo CD just to be
- 26:16a UI is is or
- 26:18>> Yeah. Yeah. Exactly. You want Argo CD to
- 26:21take whatever is in git and fire it
- 26:22straight at Kubernetes. Exactly. And
- 26:24then get back to that's that's one thing
- 26:26I I use Argo CD and ang
- 26:31>> crazy like why mix it up.
- 26:34>> Yeah. So some so they build all these
- 26:35amazing customized plugins and Helm
- 26:38plugins to run on the Argo City server
- 26:40and that's the first thing I throw out
- 26:42because you want
- 26:44>> you and I
- 26:46pattern
- 26:47>> sorry
- 26:48>> you and I are the are a little bit too
- 26:50similar
- 26:52>> but but you know why this is relevant
- 26:54because this is called the rendered
- 26:56manifest pattern and the co and the core
- 26:59creator of Kubernetes like one of the
- 27:00co-founders Brian Grant and one of the
- 27:03co-founder founders of of of the idea of
- 27:05githops uh for flux with weave and you
- 27:08know there's flux cd and there's argo cd
- 27:12>> yeah I don't yeah flux used to be a
- 27:14contender right
- 27:15>> I think ar flux is still a contender
- 27:17they broke it down into microser they
- 27:20make it it's way more performant but it
- 27:22doesn't have a fancy UI so everyone
- 27:24loves Argo CD but nobody like flux is
- 27:27still evolving but again like I haven't
- 27:29ran communities for 2 years but what I
- 27:32wanted to say is that the guys that are
- 27:35very, you know, smart people, [laughter]
- 27:38Brian Grant and um Richardson, uh from
- 27:40Weave, they created the logical
- 27:44extension of this rendered manifest
- 27:47pattern. So basically the idea of like
- 27:49you you make sure that everything gets
- 27:52rendered down into manifest into git. So
- 27:54Argo CD can purely track a raw manifest
- 27:57and just fire it off after Kubernetes
- 28:00and then you you are able to validate
- 28:01immediately what is the error message
- 28:03that that Kubernetes sends back because
- 28:04it just relates directly to whatever you
- 28:06have in git. So you can see very
- 28:08clearly. So they evolved that pattern
- 28:10and they call it config hub. So instead
- 28:12of just like having a very dumb git
- 28:14database, they built a specialized
- 28:16database for for for uh storing these
- 28:19configurations. And then the idea of
- 28:22like um making a change, you can go
- 28:24straight into config hub and make a a
- 28:26change where it needs to be. So you
- 28:28don't need to go through the git
- 28:29pipeline. Um and then you can also call
- 28:32functions if you need to make a change
- 28:33across
- 28:34>> I thought we thought I thought we
- 28:35established that changing things outside
- 28:37the the pipeline is a bad idea.
- 28:40So, so they turned it upside down and
- 28:43they they provided an a config hub that
- 28:47helps you make changes in a controlled
- 28:49way and in a repeatable way because it's
- 28:51kind of like functional programming. You
- 28:53can register endpoints on top of your
- 28:55config data and then you can apply
- 28:57functions. So, mutate your config data
- 28:59across your whole environment and then
- 29:01you can do it with an approval step uh
- 29:03workflow. So you you just select what
- 29:05you want to affect, you apply the
- 29:07function, you can see a preview, and
- 29:09then you can approve and then boom, it's
- 29:10GitOps. It gets ops in a in a in a like
- 29:14reasonable way.
- 29:15>> Have you used this product? Have you
- 29:17used this yourself?
- 29:19>> Uh no, but I um I understand the idea
- 29:22because a lot of what what he built
- 29:24originally with customize, you know, the
- 29:26idea of applying JSON patches, they kind
- 29:28of like extended it as those get JSON
- 29:31patches now run as part of like ant
- 29:33hooks. haven't used it. They just made
- 29:35it like
- 29:35>> Oh, yeah. We were talking about hooks
- 29:37yesterday. What was using hooks again?
- 29:39Oh my god.
- 29:42>> Oh, can do can do
- 29:44>> Yeah. Yeah. The hooks thing is
- 29:46>> in the CDK as well.
- 29:48>> This kind of a little bit different.
- 29:50Hooks.
- 29:51>> Yeah. But this one in my mind
- 29:54>> I don't know if config hub can can
- 29:56manage any other configuration except
- 29:59for Kubernetes. This this is like firmly
- 30:01settled in the idea of like a
- 30:03reconciliation loop and and having a
- 30:05control plane that runs that constantly
- 30:08runs these reconciliation loops and
- 30:10automatically adjust your like with
- 30:12eventual consistency adjust your your
- 30:14cloud towards it. Right?
- 30:17>> So which is one thing that Terraform
- 30:19does not have right terraform you run an
- 30:21apply and it doesn't touch it until the
- 30:23next time you run an apply where
- 30:24Kubernetes is constantly re-evaluating
- 30:27your infrastructure and making sure that
- 30:28it is aligned. I the the one thing
- 30:33uh
- 30:35[snorts]
- 30:35was so like let me start with the
- 30:38problem at what we're using terraform
- 30:42uh actually this is a problem with CDK
- 30:44too the whole CDK deploy thing is a bit
- 30:46slow but okay never mind that
- 30:48>> that's cloudformation issues
- 30:49>> that's that's infrastructures yeah
- 30:51that's that's cloudformation issues but
- 30:54um stop me if I talked about this before
- 30:57but one one issue that we have right now
- 30:59is that we're using uh database we're
- 31:02using Terraform to to manage Snowflake
- 31:05and we don't want to we don't want to
- 31:06delete the resources because that could
- 31:08lead to data loss and all
- 31:10>> stuff and we don't want to recreate
- 31:12resources. So, so I have I have like
- 31:15some crappy
- 31:16>> worried about constantly re like
- 31:18>> Yeah, I have some crappy what do you
- 31:20call it? You know, uh GitHub workflow
- 31:23where I basically inspect the plan to
- 31:25make sure to make sure it's not deleting
- 31:28anything. But I thought to myself, come
- 31:30on, there's got to be a better way
- 31:31because because right now we have a we
- 31:34have a separate plan and an apply stage.
- 31:35Why? Because we want people to do a plan
- 31:38before they know what they're doing
- 31:40before they delete things.
- 31:42Unfortunately, no one really reads the
- 31:44plan in all honesty. So, there's that
- 31:47problem. So, so hence I have some crappy
- 31:50code to check for for some a deletion or
- 31:53a a recreate. And I just think to
- 31:56myself, is this the way people do it? Is
- 31:58there a better way?
- 32:01I mean, that that sort of life cycle
- 32:05type thing kind of sucks.
- 32:08That's my current.
- 32:09>> Yeah. And that's also why a lot of
- 32:11people when we talk about crossplane
- 32:13there people very um
- 32:17pessimistic around it because they put
- 32:19so much um official or orchestration
- 32:22around this you know plan and apply.
- 32:25they have a a big like ceremony around
- 32:29the process and so something going
- 32:31behind the scene and constantly
- 32:33reconciling kind of feels wrong to them,
- 32:35right? Uh and I think it really depends
- 32:37on the maturity. If you're Google and
- 32:40you're deploying a thousand times a day,
- 32:41your services are reconciling and this
- 32:43is how you build your architecture. I
- 32:44guess if you I guess the there's an
- 32:47there's an adage with when it comes to I
- 32:50mean this is probably one of the first
- 32:51things I learned when I got into
- 32:52infrastructure is like don't manage your
- 32:56database in infrastructure is code
- 32:59you know because because then you won't
- 33:01have these problems like separate the
- 33:03data
- 33:05>> so that was definitely s uh like true
- 33:07for the longest time because stateful
- 33:11kubernetes cluster
- 33:12>> like
- 33:13maintaining database in and I think
- 33:15there was a Kubernetes uh controller or
- 33:18something where you could spin up a a
- 33:21database and everyone said no this is a
- 33:23terrible idea
- 33:24>> and I and quickly caught on to why
- 33:28>> if I talk about 2016 then stateful sets
- 33:31are like just introduced.
- 33:34>> Yeah.
- 33:35And and so at the time the problem with
- 33:38Helm is that everyone can just pull a
- 33:40chart and go like, "Oh, uh, Helm
- 33:42installed MySQL. There I go. I have
- 33:44MySQL now." Yes. But you know,
- 33:47>> set up a huge cluster.
- 33:49>> Yeah. What what where where is the data
- 33:51stores? Oh, so it's provisioning an EBS
- 33:53volume. How how is the ownership of that
- 33:55EBS volume tracked? Like what if you do
- 33:57an upgrade? How do you manage? And then
- 33:59people they built this is like you know
- 34:01pets versus cattle where you're building
- 34:05yes you're creating a a cattle of nodes
- 34:07but you're building pat kubernetes
- 34:09clusters. So so what is the the point of
- 34:12pat kubernetes clusters then you need to
- 34:14start bu using arcane or whatever it's
- 34:16called to to create backups of your
- 34:18clusters and your control plane. I never
- 34:20like that idea. I always made my cluster
- 34:23completely stateless so that I can
- 34:24rebuild it
- 34:25>> a thermal I don't know.
- 34:27>> Yeah. So all of all of the state lives
- 34:30outside right that's how you want to
- 34:32build your microservices if you can
- 34:34depending on you know what is the SLAs
- 34:36and and what is your your architecture
- 34:39that you have to support um but if you
- 34:41can and you can perfectly scale
- 34:43horizontally and you keep all of your
- 34:44data on a different tier outside of your
- 34:46cluster then that makes life so much
- 34:48easier because you can just blow away a
- 34:50cluster and rebuild it. Yeah.
- 34:51>> You can just put them side by side and
- 34:53they can share the state outside of the
- 34:55cluster. Um and then once you start
- 34:58building stateful clusters, your SLOs's
- 35:00are completely different. Your your
- 35:01operations around those clusters are
- 35:03completely different.
- 35:04>> Yeah. But but don't you think that like
- 35:06like just going going back to CDK like I
- 35:09mean a lot of tooling does bring state
- 35:11into it, doesn't it? A little bit.
- 35:15Sorry about CDK and and like uh sorry to
- 35:18I'm just trying to bring it back to
- 35:22to CDK like like like doesn't CDK I
- 35:26think we talked about it yesterday but
- 35:27like doesn't CDK have like a strong
- 35:29concept of context or something like
- 35:31that and that in itself is a state isn't
- 35:34it I mean
- 35:36so on one side in these traditional
- 35:38infrastructure as code frameworks you
- 35:40have the concept of a state like cloud
- 35:42form keeps track of the resources it
- 35:44created And Terraform has a state file
- 35:46that keeps track of the resources it
- 35:48created. So that it knows, you know, it
- 35:50ties back those logical ids in the state
- 35:53file to the actual physical ideas. And
- 35:55if you remove a logic ID in your
- 35:56configuration, it will make sure that
- 35:58that resource is deleted. And if you
- 35:59modify the configuration,
- 36:01>> yeah,
- 36:02>> it will make sure that the actual
- 36:03physical ID uh resource is updated.
- 36:05Right. So
- 36:06>> it uses a state file.
- 36:09>> Yeah. So basically I'm just
- 36:12uh wiring these in my brain. I mean I'm
- 36:15crosswiring these in my brain. Like if
- 36:18we have infrastructure and we want to
- 36:19have a goal of keeping separate state
- 36:23I guess maybe it should be scoped to
- 36:26application state or something but but
- 36:28it's it's um it's not I mean if you're
- 36:33religious about separate state it's not
- 36:37that clear to me separate cleanly
- 36:40>> you wouldn't run a terraform controller
- 36:41in your kubernetes because that means
- 36:43you're adding state to it or the
- 36:45terraform controller must have access to
- 36:47an external state bucket uh within the
- 36:49>> Yeah, it's got to it's got to be it's
- 36:51got to be a very clear division, right?
- 36:52>> Yeah. So, that's a problem with
- 36:54crossplane, right? Because where does
- 36:55crossplane store that state tracking? It
- 36:58stores it inside the Kubernetes cluster
- 37:00control plane.
- 37:01>> So, now you've created a stateful
- 37:03control like control plane. You've
- 37:04created a stateful cluster.
- 37:06>> So, so that's where where like you know
- 37:09you're using crossplane to bootstrap
- 37:11Kubernetes and that becomes a stateful
- 37:13cluster. So you need like one Uber
- 37:15cluster that controls all the other
- 37:17clusters and that becomes your stateful
- 37:19cluster that you need to do very careful
- 37:20upgrades around operations are are
- 37:23different. And of course it makes sense
- 37:24for a company like Upbound which
- 37:26sponsors crossplane to say hey you know
- 37:29we are your your Uber cluster we manage
- 37:32that for you. We we provide you a
- 37:34stateful cluster. We guarantee that your
- 37:36your control plane is backed up and can
- 37:38be res restored and we're we're going to
- 37:40take care of that. And that's the you
- 37:42know the the managed service offering
- 37:44that they provide. Um and that's why
- 37:46they they they create something like
- 37:48crossplane right. Um and I think Google
- 37:51cloud went the same way. They have like
- 37:54service connect or config connect. They
- 37:57have a service in GCP that's very
- 37:59strongly based on of off crossplane that
- 38:01basically you you you you define and and
- 38:05to be honest Kubernetes is already
- 38:07taking care of a lot of your a your
- 38:09cloud resources right because when you
- 38:11say I have a service and I need to make
- 38:12make it externally exposed it goes and
- 38:15creates a load balancer right so you
- 38:17already have a cloud controller inside
- 38:18Kubernetes creating um AWS resources you
- 38:22have a controller that creates nodes to
- 38:24add capacity to the cluster you have a
- 38:26controller that that um creates um
- 38:30routing rules if you are depending on
- 38:32what type of uh networking that you set
- 38:34up so that your your uh routing tables
- 38:37can route the traffic between your pots
- 38:38across the nodes. So, Kubernetes control
- 38:41plane already modifies your cloud and
- 38:44creates resources in the cloud. So, it
- 38:46makes sense to extend that and also
- 38:47create databases and buckets and
- 38:50>> Yeah. Yeah. This is this is where things
- 38:52get look crazy to me.
- 38:54>> Yeah. I mean I I [sighs] see the point.
- 38:58I I think if you're going all in and
- 39:00you're a big Kubernetes shop, it makes
- 39:02sense. The only biggest issue I have
- 39:04with Kubernetes is that you have these
- 39:06declarative YAML that becomes super hard
- 39:08to to manage and then solutions like
- 39:10config hub make sense because now you
- 39:12can define your load balancers, your
- 39:14buckets, your databases, everything in
- 39:17config hub and let the reconciliation
- 39:19loop constantly. tell okay maybe let's
- 39:23turn the conversation back to AI like if
- 39:26you were to if you were if you were to
- 39:29like start on a green field project and
- 39:31use Claude to to set up um
- 39:37I don't know we kind of do need to scope
- 39:40this to some sort of example let's say
- 39:42that we need to run um I don't know
- 39:47WordPress
- 39:48at scale you know WordPress.com
- 39:51Uh, so PHP, MySQL, blah blah blah.
- 39:56[snorts] the
- 39:58>> be careful. Would you do would you do
- 40:00that in Kub would you do that in
- 40:01Kubernetes and and just let Claude
- 40:05spin up some
- 40:07uh I don't know CDK uh what did we call
- 40:12it CDK Kubernetes like what what would
- 40:14give the best
- 40:17iteration you know what would give the
- 40:19best AI friendliness slash
- 40:22iteration loop
- 40:26is what I'm thinking
- 40:29Oh. Um, so this are you thinking about
- 40:33what type of system would be able to
- 40:37leverage AI in the me like the best way?
- 40:39Yeah. Would be intuitive to the AI,
- 40:42right?
- 40:42>> Exactly. So, so the so that kind of
- 40:46assumes some the AI is sort of maybe
- 40:50kind of familiar to the workflow. I
- 40:53mean, you don't want to spend too much
- 40:54time teaching it something new, I
- 40:56suppose, is what I'm trying to lose.
- 40:59>> So, that's where everyone jumped on
- 41:00creating MCP servers or or finding ways
- 41:03to to provide the LLM, the generic LLM
- 41:06that has been trained of lots of data to
- 41:09basically give it the right context for
- 41:12the work that it needs to do. So, if
- 41:15you're take a generic
- 41:17>> MCP, MCP is more for doing tool calls
- 41:19than giving context.
- 41:22Some people seem to mix that up a bit.
- 41:24>> I think it's No, it's the difference is
- 41:27tool calls allow you to pull in context
- 41:30on demand. The LLM sees a tool that says
- 41:33you can call me to get information about
- 41:35the weather in in London. Um, you can
- 41:38call me.
- 41:40>> So, it's tool calls
- 41:41>> give the LLMs the arms and legs to reach
- 41:44out into the world to find information
- 41:46that it doesn't have.
- 41:47>> So, it can do it on its own. If you if
- 41:50you don't use tool calls, you as an
- 41:52operator of the LLM have to kind of
- 41:53figure out everything that that LLM
- 41:55might need to solve the problem that
- 41:57you're trying to do, right?
- 41:59>> On the subject of tools, you know,
- 42:01Kubernetes tools, cubectl is pretty
- 42:04pretty awesome, isn't it?
- 42:07>> Um, so that's where things have evolved,
- 42:11right? If you if you use Claude Code
- 42:12skills and you give it a high level
- 42:14overview what cubectl can be used for
- 42:16and then it goes and finds out more
- 42:17information about like the user has a
- 42:19problem uh with autoscaling and I need
- 42:22to figure out if there's enough capacity
- 42:24in the cluster and then it goes off and
- 42:27uh finds the cubectl commands that you
- 42:30know tells it how much like the top like
- 42:33node stop for example to see how much
- 42:35CPU is being used across the cluster.
- 42:37So, so skills are this like gradual
- 42:39discovery of information without
- 42:43overloading the context with every
- 42:45possible
- 42:46uh tool that the QTL exposes, right?
- 42:49because ultimately cubectl can be used
- 42:51in such a way that you can overload um
- 42:53with like hundreds of tools but you you
- 42:56need to slice it and dice it down into
- 42:58like you know if you're working on this
- 43:00particular problem then you might want
- 43:02to look at this set of tools uh and if
- 43:05you want to work on that type of problem
- 43:06you want to look at this set of tools so
- 43:08then cloud knows like hey I'm looking at
- 43:10this type of problem oh can can we go
- 43:12look at those set of tools and then
- 43:13loads them in and figures out that it
- 43:15needs to like
- 43:16>> that's what what what the skills changed
- 43:19compared to tools.
- 43:19>> Yeah. Yeah. But like yeah, sorry.
- 43:22>> But which which infrastructures code
- 43:25technology has the best tooling in that
- 43:28regard?
- 43:30Kubernetes does come into my mind
- 43:34or do you think CDK is uh I mean are you
- 43:40managing infrastructure with AI and CDK
- 43:42is my next question.
- 43:43>> Actually funny I can give you an
- 43:45example. Um because when I built Terra
- 43:48constructs I copied the AWS CDK
- 43:51interfaces. So my company they adopted
- 43:55GitHub copilot into PR review process
- 43:59and my colleague created a pull request
- 44:02with Terra constructs that basically
- 44:05creates a load balancer sets up
- 44:06listeners and things like that but the
- 44:08code is TypeScript and it looks like AWS
- 44:11CDK. So copilot started to to comment on
- 44:14it and say like hey um your load
- 44:16balancer listener here uh is not using
- 44:19TLS or whatever. So even though um you
- 44:23know it hasn't been trained on terra
- 44:24constructs and
- 44:26>> and it had no it had no like uh what do
- 44:29you call this type hinting or
- 44:31>> no nothing I I I think you know big part
- 44:34of the corpus I don't think we can
- 44:35imagine how much of of of you know these
- 44:38weights actually encapsulate it's like
- 44:40billions of of internet data you can ask
- 44:43it something silly like um you ask about
- 44:46cats in in in in uh in Dermund Belgium
- 44:50and they will tell you about a tradition
- 44:52back in the Middle Ages where they throw
- 44:54cats off the walls and it's like who
- 44:56would know that, right? And and it's not
- 44:58made up like it's true.
- 45:00>> Why did they throw cats onto walls?
- 45:02>> After the winter um they they they kept
- 45:05cats to kill to prevent the mice to eat
- 45:08the grains or something or to bite the
- 45:10rats or the mice were were destroying
- 45:12the all of the storage like the linen
- 45:15and so on. So, so they have cats to
- 45:17hunt, but then when the summer comes
- 45:18around, they have too many cats, so they
- 45:20threw them off the off the off the
- 45:22towers. Uh, tradition, Belgian
- 45:25tradition.
- 45:27>> So dark. [laughter]
- 45:29>> So, this is one thing,
- 45:30>> but with Belgian, it's always like some
- 45:32dark stories like
- 45:34>> Yeah. So, if it knows this horrible
- 45:35detail that we Belgians have been trying
- 45:37to hide, how of course it's going to
- 45:39know how to write AWS CDK, you know.
- 45:42[laughter]
- 45:44>> Interesting. So, so you're basically
- 45:46saying that it doesn't matter what you
- 45:48use, AI is going to be flexible enough
- 45:50to get you there.
- 45:52>> And what I'm saying is for me and the
- 45:55reason why I spend all this time on what
- 45:57I'm doing for me AI is is pure
- 46:00intuition, right? All of this
- 46:02hallucination which we sometimes we
- 46:05don't like, but sometimes it is pure
- 46:07like out of the box thinking and we
- 46:09embrace it. All of this hallucination is
- 46:11intuition. it's built into the model to
- 46:14like feel like that's the way I need to
- 46:17go. So whatever you know framework you
- 46:19work with should be an intuitive
- 46:21framework. So I feel AWS CDK is
- 46:25beautiful because it's all about
- 46:27intentoriented methods. It's not like
- 46:30this massive declarative get every
- 46:31single attribute correct or it's not
- 46:33going to work. It's intuitive. It's like
- 46:36I want to deploy I want to deploy my
- 46:39service. I want to spread it one per
- 46:41node. Um and and I want the spot
- 46:43disruption budget. That's a good
- 46:46intuition.
- 46:47>> Yeah. So that's where I feel like it's
- 46:49been trained heavily on Typescript and
- 46:51JavaScript because that's like still in
- 46:53the top one languages of of Stack
- 46:55Overflow every year. So it has a massive
- 46:57amount of JavaScript samples and
- 46:59TypeScript samples. It has I don't know
- 47:01probably more JavaScript and it has the
- 47:04ideas and hallucinate and hallucinates
- 47:06constantly. It's actually not Lams is
- 47:09all hallucination like every single
- 47:11token it outputs is just hallucination
- 47:12and int intuition right so the fact that
- 47:16it's correct these hallucinations are is
- 47:19is mindboggling right uh but the fact
- 47:22that it can generate AWS CDK correctly
- 47:25and in Typescript to me is proof that I
- 47:29would rather um focus on a highle
- 47:32language like that
- 47:33>> yeah but don't you think it's strange
- 47:35don't don't I mean surely
- 47:38going back to what I was asking earlier
- 47:39like so you don't give a type hinting
- 47:42like surely if you if you if you let uh
- 47:46Claude I mean VS code must somehow do
- 47:49this but like if you open up a project
- 47:51with with uh with with type checking
- 47:55then
- 47:57and you let AI make some you let Claude
- 47:59make some changes surely it it can
- 48:02recognize that it's done a bad change
- 48:04when the uh LSP starts That's this is
- 48:07the agent's shell, right? This is how
- 48:09the shell surfaces the information
- 48:13to the LLM. It captures a whole bunch of
- 48:15information. It also gives it guidelines
- 48:16like I made a change. Like if you look
- 48:18at cloud, it will say I made a change to
- 48:19this file. Let me make sure I don't know
- 48:21it says low bandwidth. Maybe my
- 48:22connection is bad.
- 48:23>> Yeah. Yeah. You just dropped out a bit.
- 48:26>> Sometimes cloud says,
- 48:28>> yeah. So, so cloud will say I made a
- 48:30change to this file. Let me run the
- 48:31tests or let me let me run this. This is
- 48:34like agent shell instructions, right?
- 48:36This is like part of Claude Code's magic
- 48:38sauce. It just it just says like you do
- 48:41this then you do that. You run this
- 48:43tool. You connect to the IDE and look
- 48:45for the problem. If you go to Visual
- 48:47Studio Code, you can see problems and
- 48:49say file. Exactly.
- 48:51>> Yeah. Language servers integrations and
- 48:53so on. So this is agent cell. This is ID
- 48:55context. This is what makes a coding
- 48:57agent good at what it does by by
- 49:00surfacing the information in small bits
- 49:03right when it's needed. Um,
- 49:05>> yeah, it's it's it's it's such an
- 49:07incredible technology, isn't it? It's so
- 49:10incredible.
- 49:11>> And and so what I wanted to give you an
- 49:13example of where I think it's obvious
- 49:16that cloud will not be good at doing
- 49:19things with Terraform compared to AWS
- 49:21CDK.
- 49:22>> Okay, juicy. I had the requirement
- 49:28a theory to set up swap files for nodes
- 49:32because we wanted to allow bursting. You
- 49:34know, you can overshare resources on a
- 49:36node and we wanted sometimes resources
- 49:40to be overs subscribed and some services
- 49:43to basically burst out and take more
- 49:45memory than the node has. So we wanted
- 49:47to alleviate some of the pressure by
- 49:49creating a swap file on disk. So I asked
- 49:52cloud to help me prepare the launch
- 49:54templates for the autoscaling group. And
- 49:56this was pure terapform, no AWS CDK. And
- 50:00to do the swap file configuration, you
- 50:02have to define the swappiness on the
- 50:05task definition. But on Terraform, the
- 50:07task definition is a massive JSON blob,
- 50:09right?
- 50:10>> It's just a massive JSON definition. And
- 50:12cloud can do like the first level of of
- 50:15of um of attributes of this JSON
- 50:19definition. it it can do it decently,
- 50:21but it when I mention about swappiness,
- 50:24it also just put the attribute
- 50:25swappiness straight on like the the top
- 50:27level as an attribute as a field on a
- 50:29JSON document and it didn't work. Uh or
- 50:32it looked like it worked. It didn't give
- 50:33me any errors, right? But when I looked
- 50:35into it, it actually didn't work. And I
- 50:37had to look really deep into AWS docs to
- 50:39figure out that swappiness was not a top
- 50:41level field, but was nested within
- 50:43something called kernel attributes or
- 50:45something like that. So on the ECS task
- 50:47definition, you had to create a field
- 50:49called kernel attributes. I'm not sure
- 50:51I'm just making that up, but it was
- 50:52something like that.
- 50:54>> And then there was a field under there
- 50:55called swappiness that you had to set to
- 50:57like a certain value to actually take
- 50:59effect. Now both the AWS API did not
- 51:02throw an error because it just ignored
- 51:03any unknown fields and and cloud did not
- 51:06know what was wrong because it's just
- 51:09it's just a JSON blob. But if I look at
- 51:11AWS CDK, they actually exploded this
- 51:15this this into a construct. They created
- 51:18a task definition construct and every
- 51:20possible field um is properly structured
- 51:23in a TypeScript interface. So if you put
- 51:25swappiness of the top level, you get a
- 51:27TypeScript error that doesn't compile.
- 51:29>> Yeah, but that but but you're assuming
- 51:31that someone's done the work in the CDK
- 51:34band. And that's the craziness about the
- 51:36AWS CDK is that somebody has been doing
- 51:39the work for 10 years and it's likeund
- 51:41contributors and it's spread across
- 51:43>> but that could work against you. They
- 51:45might not have been well maintained and
- 51:48you can't set
- 51:49>> well that's why a framework like that
- 51:51needs to be backed by the cloud
- 51:52provider. This only works on AWS CDK
- 51:55because AWS invests resources into
- 51:57building this library. And that's why
- 51:58AWS CDK is much more powerful than
- 52:00Terraform because it's backed by AWS and
- 52:02fine-tuned for its cloud.
- 52:06>> And
- 52:08that's what they use internally is what
- 52:10we
- 52:11>> exactly because when I look at the pull
- 52:12requests, they're like, I'm at a service
- 52:14team of AWS and we need this, you know,
- 52:17this particular EC2 or task definition
- 52:20field needs to be made available. On the
- 52:22topic of CDK, um, let me just share my,
- 52:26uh, thing again. I had a question for
- 52:29you on operational flexibility
- 52:36or operational features.
- 52:39Okay. So, so here's an example. Uh I'm
- 52:43I'm maintaining u let's just call it an
- 52:46airflow an AWS ma MWAA airflow instance
- 52:50at work and it's getting overloaded. I
- 52:54need to scale it up quickly. So in
- 52:56terraform
- 52:57if I was man if I was managing airflow
- 52:59in terraform I would set the CPU type
- 53:03from
- 53:05I don't know T1 to T5 or something M1 to
- 53:09M5 or something right and then I do then
- 53:13I do a plan and then I do apply and I
- 53:16don't know half an hour later the
- 53:18instance of airflow would have been
- 53:20updated
- 53:22in AWS CDK land
- 53:25Um, again, I don't think it's any
- 53:27faster, right? You you would still have
- 53:30to go into your CDK code, change of
- 53:34change something, and then do a CDK
- 53:36deploy, and it's probably the the same
- 53:39amount of time as the Terraform plan and
- 53:41apply. Right?
- 53:43What I'm trying to say here is that is
- 53:46that is there
- 53:48um what's the quickest way to make a
- 53:50quick change in of these technologies
- 53:54besides don't say click ops I mean yeah
- 53:56I I think click ops is probably the
- 53:58fastest you know what I mean the speed
- 54:01to make a change
- 54:03>> I don't think we captured it very well
- 54:08>> um
- 54:10yeah I
- 54:12It's a trade-off, right, that you you I
- 54:15it's all or nothing in these frameworks,
- 54:17right? You either go all in and you make
- 54:20single source of truth, Terraform, and
- 54:22there's no way of making a change
- 54:24outside of Terraform. Um or you
- 54:28completely ignore that attribute in
- 54:30terapform and then people can change it
- 54:32and Terraform will not complain or try
- 54:34to revert it. You know, you can say life
- 54:36cycle ignore this attribute so try to
- 54:40reset it. Um that's where other
- 54:43frameworks recently try to improve
- 54:46because they say by nature the cloud is
- 54:48birectional. It's not one way. You know
- 54:52forcing your infrastructure as code to
- 54:54be single direction single sort of truth
- 54:57in practice doesn't work. It slows teams
- 55:00down and that's where config that all of
- 55:03what I just said is basically from a
- 55:04block um series from Brian Grant, right?
- 55:08the guy who who then announced uh Config
- 55:10Hub. So, their idea is that you must be
- 55:13able to go into your config store and
- 55:16change a value and have it applied
- 55:17quickly without going through a massive
- 55:21um and slow uh process. But that's a
- 55:25trade-off, right? I mean their point is
- 55:28that if you do it through our system I
- 55:30guess there's more tracing and more
- 55:32control over it than if somebody goes in
- 55:33click ops at least as the config field
- 55:35is stored inside the data and you can
- 55:37have an audit trails there. I don't know
- 55:40I do feel you get you can you know have
- 55:43your cloud trail
- 55:45events siphoned off to just note what
- 55:50infrastructure changes they are.
- 55:53>> Yeah. Um so system initiative they also
- 55:56have this idea of we are a digital twin
- 55:59and we synchronize whatever you do in
- 56:01AWS back
- 56:03>> I need I need to give assistive
- 56:05system initiative a trial before I meet
- 56:08up go meet up with
- 56:11>> they have great ideas I mean the people
- 56:13behind it have a lot of experience with
- 56:14chef and puppet and there some of the
- 56:17you know original creators of some of
- 56:19the ideas of how chef originally worked
- 56:22and they carried over after working with
- 56:24Terafhone for a long time and and they
- 56:26they they just built a new idea and the
- 56:30way I understood from his podcast that I
- 56:33I listen was that system system
- 56:35initiative is a programmable graph. So
- 56:37you create nodes and every node in the
- 56:42graph has hooks like create, read,
- 56:45update, delete and those notes those
- 56:48hooks are all programmable. So you can
- 56:50decide this node
- 56:54It doesn't. Yeah. This node if it gets
- 56:56created, this is how the function runs.
- 56:58And this node if it needs to be updated,
- 57:00this is what function it runs. And you
- 57:03can therefore build your own nodes. It's
- 57:05kind of like terapform provider
- 57:07resources, right? But all split out into
- 57:09individual node because a terapform
- 57:11provider resource has create, read,
- 57:13update, delete hooks, right? And the
- 57:15telephone provider just looks at the
- 57:17graph, determines that note needs to be
- 57:20updated and then calls the update hook
- 57:22for that resource and gives it the um
- 57:25you know the actual values and and the
- 57:27the new values and then that resource as
- 57:30part of the provider will apply those
- 57:32changes by making the correct AWS API
- 57:34calls. Right? So they they kind of take
- 57:36this terapform provider but they split
- 57:39it out into individual programmable
- 57:41nodes and then they they reimplemented
- 57:44each of those nodes. What I don't like
- 57:46as far as I understand is that under the
- 57:49hood every single function of those
- 57:52nodes is like using AWS CLI commands. So
- 57:56it doesn't like it
- 57:58>> and and
- 58:00I don't know because honestly if you I
- 58:03think they spent four years rebuilding
- 58:04Terraform provider AWS by defining every
- 58:07resource type as a node and giving it
- 58:08create read update scripts you've only
- 58:12done the very basic foundation because
- 58:15what really makes infrastructure as code
- 58:17powerful is like what I just told you 10
- 58:19years of AWS CDK and hundreds of
- 58:20contributors splitting out every
- 58:22possible field and building integration
- 58:24pattern.
- 58:26Right?
- 58:27Imagine you spend four years
- 58:29re-implementing Terraform providers and
- 58:31offering it as a solution and you
- 58:33haven't even gotten to the level of like
- 58:35now I have a lambda and a gateway and I
- 58:37need to integrate them and that means I
- 58:38need to call all of these resources and
- 58:40I need to call all of these hooks in
- 58:42sequence. You're you've you
- 58:44>> Yeah. But the
- 58:46but in a in an in a in a in an ideal
- 58:51world the AWS CLI should be exposing
- 58:55these things should be exposing even
- 58:58these high level obstructions in some
- 59:00ways the AWS CLI
- 59:03um I mean I'm just playing devil's
- 59:05advocate here
- 59:08>> the CLI should be should be actually the
- 59:11interface
- 59:13should be enough is what I'm trying to
- 59:15say.
- 59:16>> Yeah. So, I haven't played enough with
- 59:18system initiative, but I can imagine
- 59:21that based on what he says, if they
- 59:24started from scratch, it would take an
- 59:26immense amount of work to reach anything
- 59:28like AWS CDK level of UX
- 59:31>> or DevX developer experience. And sure
- 59:34you can show a demo which he says we you
- 59:37know we have a demo where you give us
- 59:39your AWS account and we point system
- 59:41initiative and it at it and it will very
- 59:44quickly create your AWS account
- 59:46resources as a digital twin in our graph
- 59:48our programmable graph and you can
- 59:50immediately start modifying them through
- 59:53our interface with our digital twin
- 59:55technology but that doesn't talk about I
- 59:59am a devop developer and I need to
- 1:00:01deploy nextgs
- 1:00:03And I don't care how to set up API
- 1:00:06gateway and every single lambda so that
- 1:00:07nextgs has a server side and can execute
- 1:00:11right because that is what a developer
- 1:00:12wants to do. This is the actual
- 1:00:14functionality like I started Terraform
- 1:00:16sorry I started my career you know
- 1:00:18understanding how the control plane
- 1:00:20works how reconciliation loops works but
- 1:00:23if you work for an organization
- 1:00:26nobody cares right we need to deploy the
- 1:00:28feature and what is the best
- 1:00:30architecture for us to deploy it I don't
- 1:00:31care how kubernetes you know atcd needs
- 1:00:34to be set up and backup procedures and
- 1:00:36all that you want to write code
- 1:00:39>> yeah I I that is the business value
- 1:00:41unless you're you're a hosted kubernetes
- 1:00:43this cluster provider as a DevOps
- 1:00:46engineer you're coming in and only
- 1:00:47knowing how to set up clusters you don't
- 1:00:49bring any value unless you can do these
- 1:00:51high level integration patterns and
- 1:00:53after you know it was very interesting
- 1:00:55for me but after doing it for five or
- 1:00:57six years I wanted to actually be
- 1:00:59valuable [laughter] you know actually
- 1:01:02focus on these hard
- 1:01:04level integration patterns as you'll as
- 1:01:07you
- 1:01:08are only really possible with CDK right
- 1:01:11Mhm.
- 1:01:13>> Yeah. So I CDK is great but there
- 1:01:18obviously I think other approaches like
- 1:01:20Pulumi they I was very surprised because
- 1:01:25CDK has this as as I just explained it
- 1:01:27has like these amazing deep level
- 1:01:29integrations within the AWS services. So
- 1:01:32if you take a TypeScript object uh for
- 1:01:34that represents an API gateway, it gives
- 1:01:36you a method to to like bind it to a
- 1:01:39lambda and it knows exactly what to do
- 1:01:40under the hood. Um Palumi is kind of
- 1:01:44like starting from scratch and then
- 1:01:46build little like helper methods on top.
- 1:01:49For example, the bucket object that you
- 1:01:51get within Palumi has the ID of like an
- 1:01:54onevent
- 1:01:56um hook and and you can put the function
- 1:01:59handler in that onevent.
- 1:02:01Uh it's on the bucket object. You should
- 1:02:03search for bucket.onvent.
- 1:02:06And apparently that's not in their like
- 1:02:08L1s but also in in their like higher
- 1:02:12level on event. Yeah, I see it's in Pumi
- 1:02:17crosswalks. So, so AWS CDK is like the
- 1:02:21the L2, right? And Crosswalks is like
- 1:02:23their version of L2. It's like you take
- 1:02:26the low-level bucket API object and then
- 1:02:29you add ideas on top of like do onevent
- 1:02:31and and that's a really neat little
- 1:02:33thing. But again it required somebody at
- 1:02:35pulley to implement the idea of a bucket
- 1:02:38a cloudatch rule an SNS topic have this
- 1:02:41idea of invoking a function and does
- 1:02:44they rep they they created a repeatable
- 1:02:46pattern that on event you pack in you
- 1:02:48pass in the function handler and it will
- 1:02:50automatically create the bucket create
- 1:02:52the lambda create the bucket
- 1:02:54notification that calls the lambda set
- 1:02:55up the lambda permissions everything for
- 1:02:57you right and then the only event is
- 1:03:00like this this um this pattern that they
- 1:03:03expose it's an interface because it's a
- 1:03:05programming language. So you can
- 1:03:06reimplement it. If you have something of
- 1:03:08your own that you want to implement the
- 1:03:09on event then you can implement exactly
- 1:03:11what are the grant permissions that need
- 1:03:13to be added to the policy. So you can
- 1:03:15implement your own on event. So that's
- 1:03:17the the the benefit of using a
- 1:03:19programming language. You can create an
- 1:03:20interface. You can define a contract.
- 1:03:22You can't do that with terapform
- 1:03:24modules. Can you try to think about
- 1:03:25doing that with terapform modules?
- 1:03:30Well, and I'm and going back to your IM
- 1:03:33example
- 1:03:36to achieve these these priv privileges
- 1:03:38without some sort of dynamism is going
- 1:03:42to be hard.
- 1:03:43>> Yeah, that's exactly because of you have
- 1:03:44this like synthesis time, lazy
- 1:03:47evaluation, late binding, setting
- 1:03:49properties after the program has
- 1:03:51executed.
- 1:03:52>> But I can't think this cuts both ways. I
- 1:03:54mean
- 1:03:58[sighs and gasps]
- 1:03:59there surely there's an argu there's an
- 1:04:01argument
- 1:04:02>> policy that you want to to attach
- 1:04:04>> there's there's an argument to be made
- 1:04:05is like as soon as someone starts
- 1:04:07writing a whole bunch of code with with
- 1:04:12like onvent uh logic it's going to get
- 1:04:15pretty probably quite difficult to
- 1:04:17follow right the beauty of opening up a
- 1:04:20lot of terraform projects is that you
- 1:04:23kind of know what's what's happening and
- 1:04:25it's kind of it's constrained by by the
- 1:04:29by the language right if if like just
- 1:04:33like any code in the world if people can
- 1:04:36do things they will and it will just get
- 1:04:38complex without any
- 1:04:40>> uh yes without any uh abandon right
- 1:04:43>> I just got the question to the today
- 1:04:45from someone he says like do you think
- 1:04:47that it makes sense to target an
- 1:04:49intermediate DSL and and when you're
- 1:04:52saying what you're saying just now it's
- 1:04:53Like with the terra constructs, if you
- 1:04:55do this complicated coupling uh of of
- 1:04:58creating a lambda in an API gateway
- 1:05:00ultimately when you run synth you get a
- 1:05:03flat config file which is the DSL that
- 1:05:05is terraform and you can run your
- 1:05:08whatever um you know llinters and
- 1:05:12problems but it's probably going to be
- 1:05:14fishly complex but yeah okay
- 1:05:17>> yeah because the cloud is complex dude
- 1:05:21>> this was I Um the trade-off is you're
- 1:05:25getting
- 1:05:27capabilities,
- 1:05:28elasticity
- 1:05:30and uptime for services to move fast in
- 1:05:35terms of a business value and does it
- 1:05:38end up being complex? What's the
- 1:05:40alternative? You're going to spin up an
- 1:05:42EC2 instance and build your own and then
- 1:05:44you know yeah on it there's different
- 1:05:47way there's different ways of looking at
- 1:05:49it like
- 1:05:54you know, the more I need to give system
- 1:05:56initiative a bit of a whirl to be
- 1:05:58honest,
- 1:05:59>> but I'm I'm start I'm but like I'm I'm
- 1:06:04my I'm working backwards from AI
- 1:06:07and I feel with AI it's about uh I mean
- 1:06:12it's also it's also about the same thing
- 1:06:14for humans really it's about iteration
- 1:06:16speed and uh
- 1:06:19>> and a to and a and a tool full chain
- 1:06:21like I'm just thinking aloud that like
- 1:06:23maybe calling AWS CLI from from Claude
- 1:06:29uh you know something where system
- 1:06:31initiative does behind the behind the
- 1:06:33scenes is perhaps not a terrible way of
- 1:06:36uh bootstrapping an account right to
- 1:06:40what it needs to do for for for
- 1:06:43a you know a typical a typical
- 1:06:47organization and let's take a step back
- 1:06:50what you just said about iteration and
- 1:06:53achieving results quickly. Um, it's kind
- 1:06:57of like how how I was understanding what
- 1:06:58you're saying. I think this is also
- 1:07:00related to people like originally people
- 1:07:02were like, "Oh, Kubernetes is going to
- 1:07:03give me this full cloud independence.
- 1:07:06I'm going to be able to do multicloud,
- 1:07:07you know, as a resilience strategy and
- 1:07:09and and everything, right?" Very quickly
- 1:07:12that breaks down because the advantage
- 1:07:14of being in a cloud is to maximize its
- 1:07:17capabilities. Like if you are an AI team
- 1:07:20and you need to set up like this complex
- 1:07:23um data ETL pipeline, but you need to be
- 1:07:26completely cloud independent and you
- 1:07:29need to do everything yourself versus oh
- 1:07:33I'm going to use some step functions or
- 1:07:35durable lambdas now and I'm going to
- 1:07:37leverage all of the serverless
- 1:07:39capabilities and I've got something
- 1:07:40working you know because you have like
- 1:07:43DBOS you just define your your
- 1:07:45programming and then under the hood
- 1:07:47whenever a function is called, it can be
- 1:07:49suspended and it can be persisted and I
- 1:07:53don't need to worry about exactly how
- 1:07:54all of that works. I can just focus pure
- 1:07:56on my business flow and it's a neat
- 1:07:59clear data pipeline and under the hood
- 1:08:01it's it's automatically creating lambdas
- 1:08:03and they are being suspended when
- 1:08:05they're waiting for events and they're
- 1:08:07resumable and it's taking care of of of
- 1:08:10um making sure that the event is
- 1:08:11propagated and no notifications are
- 1:08:13being missed and and all of this like
- 1:08:15fall torren and and and re repeat and
- 1:08:18that that letter Q setup and all of this
- 1:08:20complexity gets handled by a cloud layer
- 1:08:22and that gives you the ability to move
- 1:08:24forward and to deliver a feature that's
- 1:08:28between in in an organization
- 1:08:30that's between being the market layer or
- 1:08:33being leader of being out of out of the
- 1:08:35market and closing down.
- 1:08:40>> I worked in many organizations.
- 1:08:42>> Well, okay. Just to replay my
- 1:08:44understanding what you just said is that
- 1:08:46like if you don't uh
- 1:08:50get fine if if you don't
- 1:08:53get
- 1:08:54>> realize
- 1:08:55>> get down in the weeds then you're not
- 1:08:56really innovating type is what I is what
- 1:08:59I heard.
- 1:09:00>> It's more about if you what is what
- 1:09:04business are you delivering? What is
- 1:09:05your core business right? your core
- 1:09:07business is not creating a perfect ECS
- 1:09:09cluster and and taking care exactly of
- 1:09:11like setting up um pipeline that that
- 1:09:15does exactly one delivery of all the
- 1:09:16messages and and does does all of this
- 1:09:18core like engineering most organizations
- 1:09:22just need to deliver business value or
- 1:09:23they're or they they die
- 1:09:25>> they're out of business. Yeah. And then
- 1:09:26you
- 1:09:28>> I think you made the argument that like
- 1:09:30you can't do this in the CLI. You need
- 1:09:32to you need to get down into the the
- 1:09:34details. I mean sorry if I My link back
- 1:09:37to to what you were saying earlier about
- 1:09:40um
- 1:09:42my link back was basically
- 1:09:45maximizing highle services of cloud
- 1:09:48without
- 1:09:51um
- 1:09:53worrying about it not being reproducible
- 1:09:55or um yeah I don't know I I I had a
- 1:09:59point
- 1:09:59>> okay we we I sorry I I my kids uh need
- 1:10:03to be taken to school so I ran out of I
- 1:10:06sound like I have a point just now. I
- 1:10:08need to rewatch this to remember what my
- 1:10:09point is.
- 1:10:10>> Okay,
- 1:10:11>> I'll put it in the comments.
- 1:10:12>> We'll we'll get to the point. Thanks for
- 1:10:14watching if you're watching this. Bye.