Episode 23: Validating AI output & Refactoring Infrastructure

Published: Monday, Mar 9, 2026 • Duration: 35 minutes • Season 1

Validating AI output & Refactoring Infrastructure

Download MP3 | Watch on YouTube

Show notes: https://docs.google.com/document/d/1zoc-0L1o1Cyxtgatb9fN_ZGBGbshZIb9BTzwEj0C4Gc/edit?tab=t.0

https://dabase.com/podcast/ for a summary

Watch on YouTube

summarize "https://youtu.be/5CIEYL5HzZI" --timestamps --slides

A freewheeling engineering conversation that starts with a glasses anecdote and quickly moves into practical ways to validate AI-generated code, tighten CI/CD, and refactor infrastructure without causing resource churn; topics include model choices (Claude vs GPT variants), deterministic checks around AI output, Docker image pinning and digest problems, SonarQube and vendoring, personas/multi-agent prompts, moving docs from Confluence to Markdown for agent friendliness, and the differences between AWS CDK and CDK-TF (assets, L1/L2 constructs, and logical ID fragility). The hosts stress building validation harnesses before letting AI edit code and give concrete examples: a PR error using “env” versus “environment”, Docker buildx 0.19 versus 0.26 mismatches, “Wow, I can see everything clearly now.”, and “it’s hard to let AI go wild on that code base.”
Slide 1

Models, versions, subscriptions

One host explains he unsubscribed from one service after the Department of War situation, was offered a free month, and notes community chatter that GPT 5.4 (with codecs/fine‑tuning integrated) is being hailed as better for coding while model naming—5.2, 5.3, 5.3 codecs, ultra-think—has confused users, which motivates picking a single reliable model like Claude for some teams. Slide 2

Trust, deterministic checks, and CI

They recount a concrete failure where an AI-generated PR used “env” instead of “environment”, reviewers missed it, and stress that CI/CD tools (linters, pre-commit hooks, test harnesses) and local reproductions (Ubuntu Docker VMs) are the correct way to make AI outputs deterministic rather than trusting human eyeballs alone, while also describing Docker immutable digest pinning and the pain of keeping digests up to date. Slide 3

Vendoring, SonarQube, and makefiles

A vendored install script produced 32 SonarQube issues and forced discussion about allow‑listing versus updating each vendor bump, and they illustrate how makefile targets are a simpler, deterministic pattern compared to the phony targets AI suggested, noting Opus 4.6 produced unnecessary makefile complexity and that knowing Makefile semantics can catch AI mistakes. Slide 4

Personas, spec ledgers, and docs

They recommend running problems through multiple persona agents (business analyst, database designer, QA engineer) to cover perspectives, discuss spec ledger features vs recent Anthropic config announcements (scheduling/config sharing), and describe a push to migrate docs from Confluence to Markdown plus a Golang CLI skill to make repositories “AI ready” and easier to reference from agents. Slide 5

CDK vs Terraform refactor risks

When refactoring many duplicated AWS CDK apps into shared libraries they found logical IDs can change (causing unwanted deletes/recreates), so they compare CDK‑TF vs AWS CDK: both provide L1 constructs but AWS CDK has an advanced asset pipeline and bundling logic, whereas Terraform makes plan parsing and scripted move blocks easier—one host has a Python tool that parses a Terraform plan, maps one create to one delete, and emits move blocks with a top comment to review. Slide 6

Assets, construct hub, and build pipeline tradeoffs

They close by describing AWS CDK’s asset/bundling features (automatic Lambda packaging, S3/ECR assets) and the construct hub/ETL pipeline that leverages step functions and Lambdas, mention tools like Progen for file-system constructs, and debate zip vs Docker artifacts and how security scanners can complicate packaging decisions before wrapping up the episode.

Model: openai/gpt-5-mini

Transcript (auto-generated from YouTube captions)
Wow, I can see everything clearly now.
Are
>> are you do you have uh what do you call
it? By focal
now because you're
>> I have no idea. I have I I don't I need
to wear these for um for at the desk.
It's different from far sight. Like I I
don't need them outside. I can perfectly
see clear in the distance, but not not
like 70 cm.
Um,
>> yeah, I actually need glasses for a
while. But now, you know, when I put
them on and I see the screen, then I
realize how bad it was, like how blurry
actually my I was looking at.
>> There's a a way around that, like just
having a bigger screen and bigger fonts
and
>> Yeah. Yeah. Yeah. I definitely had like
situations where I woke up and I just
was like, I can't be bothered with this
right now. Just up the up the font size.
And then later on during the day didn't
even realize that I've been, you know,
working with the font size like this
big.
>> Cool, man. So, uh, yeah. How so now
you're you can see better, you can feel
better, you can work better.
>> It's like I'm wearing binoculars, dude.
It's like like like the screen is like
suddenly right in front of my face.
>> What? I think I have the opposite
problem. I I I see better near without
my glasses.
>> Yeah. H So I was just trying to add to
the to the AI infrastructure podcast
notes about what to talk about. I wish I
did this a bit earlier.
>> I haven't really been adding anything
there for a while.
>> There's been a lot
>> quite a lot of announcements, right?
Yeah,
>> there's been a lot. Um, I guess you're
>> I don't have a lot of time, though.
>> Oh, you're you're all in on Claude, so I
guess you haven't even bothered with uh
Open AI stuff.
>> They gave me cuz I was one of those
people that unsubscribed after the whole
um Department of War situation.
>> Oh,
>> I I went to Chat GPT and cancelled, but
then they said, "We'll give you a month
for free, so I still have access for a
month." And now people are all raving
about uh for 5.4 being um you know
fine-tuned for coding and being so much
better.
>> Well well I don't think they've released
GBT 5.4 for Codeex. Codeex is the one
that's optimized,
>> but they believe they believe it won't
because they basically integrated the
fine tuning from Codex into it and kind
of reduce reduce the confusion
>> of of the all of the Yeah, that's at
least that's Tio's theory, right? I did
watch The first 10 minutes.
>> This is where you get the news.
>> Yeah. Well, that's
>> it. To me it makes sense
>> because like all of this additional
terminology people were getting super
confused if you were open opening your
your LLM model selection it was like 20
GPT options
>> GPT 5.2 two 5.3 5.3 thinking 5.3 codex
5.3 codex ultra think
>> it's like what are you what are you
doing
>> so on different models so so I wanted to
ask you about do you use one model
against another in your workflow I mean
you showed me like months ago that you
were doing something like that like
>> yeah I was because I was getting
>> uh sorry
>> I was Because the problem was I was I
was never I was always running out of
credits on cloud, right?
>> Oh, yeah. That's true. You're doing it
as a means of necessity.
>> Yeah. But now now I I I haven't even
been able to, you know, hit my budget
limits on cloud.
>> Yeah. So that's interesting. So you were
doing it you were using multi- aents
because you're running out of credits
though. So, I'm I'm thinking using
multiple
multiple different models might be
>> constraint.
>> Yeah, it might be a quality game because
I'm I was actually a little bit shocked.
I had this experience last week where I
I uh I created a a PR. Of course, other
people approved it without asking too
many questions or I mean, it's human
approval. What do you expect?
your track record
>> and and then I noticed that um like if I
was if I was actually less trustful of
AI and I honestly looked at this patch
that I was contributing I would have
realized it was a terrible mistake it
was such an obvious mistake really like
I I used env instead of environment for
GitHub workflow and of course I didn't
really test it because it was a kind of
a trivial change but anyway long story
short this this PR that I pushed that
was AI generated was wrong and now
that's just making me very it's just
sort of like wrapped ripped my
confidence apart
and uh I'm just thinking like what can I
what like what practical steps can I do
to make sure I don't
commit junk
this has always been the job of uh CI/CD
DevOps people like my job pretty much
all the time is to set up llinters
pre-commit and all this type of stuff.
Whatever I can deterministically
validate.
>> Yeah, that that's that's the trick.
Making AI deterministic or making what
AI does deterministic though. The
trouble is is that maybe I'm just
casting shade on GitHub, but like GitHub
actions is such a pain.
The difficulty now there's action lint,
but it doesn't capture like half the
problems. it doesn't support like
actions and
>> I had the similar situation on Friday
where I was like I was working on
something related to a docker image and
yes I remember uh we need to do
immutable digest pins on the um docker
base images so when we build using a
>> file you're in a environment are what?
>> Yeah. So, so we we we have like the .NET
4 8.0 tag which is immutable because
security patches and so on, right? When
Microsoft builds a new version, they
just push it under that 8.0 tag even
though
>> it's a different image. So, they don't
accept that. So, they were like, you
need to use an immutable digest.
>> And then I was like, yeah, that's a pain
because now we have to do a schedule to
always check if there's a new digest and
bump our base images, right? It's kind
of like security like check checklist
security like do we're consuming from
Microsoft. Uh
>> yeah sure there's supply chain attacks
that can you know
>> I'm not a I'm not a fan of these
immutusable
hashes on on docker things
>> but like if Microsoft's been compromised
and their and their 8.0.NET net image is
is insecure and therefore you're saying
we cannot have I think this is the type
of nonsense um you know
>> type of security because you're actually
aggravating the issue because now you
expect the client to adequately keep up
up to
>> yeah anyway the point was that um with
Sun we had built a beautiful GitHub
workflow that was tested against uh brew
installed uh docker buildex image tools
to inspect the digest for the remote
image to figure out if we were using the
if there was a new digest. And before I
actually, you know, remove moved the PR
from draft to review ready, I asked um
Sun, hey, you know, we can test this. We
can run the Docker Ubuntu image here and
we can run the the commands that you
have in the in the in the GitHub actions
workflow. You can we can run it inside
the local Docker image.
>> Yeah.
>> Ubuntu. and it did that and it
immediately broke and there were all
kinds of problems with it because um it
was a multiarchc um digest and it wasn't
detecting the digest properly. it was
using uh a template string that didn't
work or something or
>> Yeah. And then also it was using the
docker build 0.19 whereas in in the
docker um that was on my local then it
it says oh it fails I I should do an a
instead of trying to use a temp because
you know when you do golang like docker
you can do these template strings to
extract certain fields. So you can you
can do docker inspect and then you can
pass in a template string and it will
expect it. Uh but the thing was it
didn't work and then I assumed it was
because it was using the wrong version
and I said you're using 0.19 the latest
is 0.26 and the GitHub action is using
026 and they tried that it didn't work.
Anyway the point is yeah I got so much
things wrong and even even today when I
was like um let's you use a make target.
So this is another very stupid security
problem where we have sonar cube that
lints bashcript and I'm vendoring a v a
third party supplier
>> vendoring okay vendor
>> vendoring meaning I'm inlining it into
my git because I don't want to do a curl
during my build I want to use an install
script and when in my pull request it
was flagged with 32 um sonar cube issues
and
>> if I fix them then the next time I pull
the vendor next time I update from the
vendor script, I'm going to have the
same problem. Right? So, I want to like
allow list it. I can't say whitelist,
right? I have to say allow listed.
>> Thank you.
>> I'm very
>> The audience appreciates this.
>> Yeah. Um, so so I have to I have I I
have to the I mean to me the right way
is to vendor it and get track it allow
list it. Um, but that's going to take
time because I'm in this organization
not an admin. So I I have to wait for
someone else to whitelist it. So anyway,
I says let's let's use a make target and
um you know let's make sure that we
actually do the insecure thing which is
we we um we curl it and with make
targets you can specify a file on disk
and if it doesn't exist
>> it will basically run the commands right
I mean they it will keep it even like
>> I'm the number one make file fan here
>> yeah so but the thing is when I asked
son or opus I think it was opus 4.6 six
and I said, "Let's use a make target."
It came up with all these phony make
targets to do a unsure local or
whatever. And I was like, you don't need
to do that. That's not how make file
works. You can point it to a file
target.
>> And then it was like, oh, you're
absolutely right. But you see, like
because I know make file, I know what to
tell it. Like I know this this makes no
sense.
>> It's funny how make files trip up a lot
of people and and AI in some ways. But
>> so I was I was I was all mighty. I was
like, "Haha, look at AI. You can't be
just a stupid wipe coder. You have to
know how make files work." At the same
time, I was wondering the issue really
is the make file, though. Like, if make
file wasn't this so cryptic.
>> Oh, have you heard of redo? By the way,
I sometimes use redo in my projects.
>> I you were just talking about you you
did your all your skills with just or
something like that, right?
>> No, not just. I used redo. It's a DGP.
Anyway, so going back to the the quality
thing. Okay, I I'm with you a thousand%
that we should we should do less things
in GitHub actions, do more make files.
That's what I'm that's my mantra.
>> That's not what I said, though. I just
said that that we can validate some of
it. Um, for example,
>> we can validate, we can we we can ask
the AI to do a little extra and say
like, you know, it all looks good and we
can push it and see it pass. But even
then, we're not 100% sure. We can still
use local Docker VMs with with Linux and
and and try to use that to reproduce in
Ubuntu. Oh, by the way, I wanted to say
on the subject of pinning, the one good
thing about pinning in a Docker image is
that is that you're likely to speed up
your Docker builds because
>> uh using caches and and things.
>> Yeah, you're more that's one sort of
>> Yeah. of the churn.
>> But you were basically you started
saying that um it's hard to trust the AI
outputs because it can we can still miss
things and how do we validate it? Um
>> yeah. So,
>> but you have you seen Adam Jacob's
latest LinkedIn posts about that?
I think he's been saying the same thing
like quite a few times which is like
it's it's difficult to be in this like
what's it called the the twilight zone
the where you are still validating like
you have a lot of manual code and you
still want to control what the AI output
is um and you're actually validating the
code versus you're not validating the
output you're not validating the result
and and he had quite a few posts where
he was going on about how people have a
difficulty letting go of the code and I
mean something we've been discussing a
lot as well and I kept telling you like
you know as long as we put the
deterministic checks around it then we
can uh do a lot more
>> I don't understand the oh I think this
is how you do it
>> I don't understand LinkedIn
>> there was a
>> yeah I mean there's definitely like
people who are into AI and cranking it
out
>> this one about Nick's like I've been
programming for literally my entire
life. There's um that one I think he's
talking about the fact that it's really
a big mind shift. Uh it wasn't that Adam
actually a couple of reflections that
one couple of reflections the third one
below from Adam that one. Yeah. Yeah.
that that's where he goes on and says
like it's hard to if you have an
existing large code base um it's hard to
let AI go wild on that code base
>> and it's more easy to just start from
scratch and let AI build everything and
just build all the loops around it and
that make me think I think the first
thing we need to do when we are adopting
AI into a codebase is to ask AI to
validate all of the user stories and
build a very strong build hardness don't
let AI build like modify the code let AI
build all of the validation and make
sure that the validation is correct
before you let AI loose on the code.
>> I think that a way to
>> my my colleague um was using AI with
some database flows and what I and he's
a very seasoned colleague um he's been
around the block. He's been he's been
hacking since the 80s sort of thing. And
I don't know, maybe he's listening to
different podcasts and getting his
information from different sources, but
I was really impressed that he like what
what do you what he did was that he he
set up like a flow where he was he was
using different personas like he was
saying like you know I am a business
analyst and I want this thing and then I
am um a database designer and I want
this thing. I am a QA engineer and I
want this thing. And then he basically
ran the problem through these three
agents profiles to do his work. And I
thought it was very impressive the way
he he did that. I mean, have you have
you done have you thought about personas
and in your spec ledger and things like
that? Do you
>> No, but there is quite a few.
>> I am a quality assurance engineer.
>> Yeah. I mean, a lot of people don't like
it. They say it's like it's like
theatrics. It's like you're going to a
play and it's like, you know, I'm
playing house and balls with my like
daughter.
>> Yeah. Yeah.
>> But
>> though I do I I think the the probably
the benefit really is that you have like
a fresh
context in two or three different agents
just to cover.
>> Oh yeah, for sure. I think I think it I
think people underestimate how effective
it is. I think because of these things
are language models the context and you
know that you create around them and
clearing the context and having it with
different perspective like you know
creating these personas I think it makes
sense I don't think we understand
>> you've not you've not uh implemented
>> I don't do that no I' also many people
are yeah like I just said people don't
really like that but I think it makes
sense that I'm not going to do that at
the moment for me right now the because
There's quite a few announcements lately
that really affect uh Spec Ledger's
position a lot. One is uh Antropic
announcing announcing like a um config
management as a service so that you can
share configurations uh for Claude Code.
That's something that they launched.
They added the scheduling. So people are
saying ohropic just launched openclaw
clone by making Claude Code run
independently and can run schedule task
which is a bit like one of the aspects
of open claw.
I'm actually surprised how long that
it's it's taken like I still think
>> Claude and Codex doesn't make it super
easy to share things in an organization.
>> Yeah. So so that's what Speckled Ledger
does, right? I mean we have a superbase
metadata where we are um allowing
organizations to
create skill bundles. I think Tessle
apparently does that as well. I didn't
know but like tessel they are not like
we are the scale bundle
>> uh solution to belittle anything but I
don't think it's like a huge problem to
share the prompts but like it it
absolutely it's become an industry in
itself
>> it's just it's just one of those little
things you know it's just one of those
things you easily tack tack on if you're
if you're going to provide a spec ledger
flow and you're going to create a UI
that that allows you to to visualize the
process might as well includes you know
skill bundles might as well include you
part of the bootstrap of the of the
repo. That's part of like
>> some organizations they call it a AI
readiness of a repository. Um across
teams you need to set set up your repos
so that they are ready for AI
contribution so that anyone who starts
working into it gets the best practices
gets the the skills to to set up the you
know everything. about talking about
that and best practices and
documentation. The one good thing at
work is that it just took some
convincing I feel took some took some um
posturing but I I think I have the
mandate to move everything from
confluence or p confluence to markdown.
I don't know if I've shown you this
before but like yeah basically I feel
this is going to make my life a lot
easier.
I hope you agree
>> moving away from Atlassian is uh the
sweetest uh AI move you can make really.
>> I say that but then I spend the whole
morning um create like playing with the
J CLI Golang and writing a skill for but
I'm right I wrote a skill very
explicitly customized for all the custom
fields and all the custom workflows for
one board and one team that I'm in.
>> You use the Atlassian um MCP. I know you
don't like MCP. I don't like MCPS.
>> It does work really well. This
particular one, this super set.
>> Okay.
>> Though it's got some blind size like it
doesn't work with
uh what do you call these these these
boards? White spaces. Not too sure what
they call.
>> Yeah. So, I guess it wouldn't work for
me because that's exactly what I just
did. I just took the Golang CLI that's
like the most popular one and apparently
hasn't received PR merge. So, I I forked
it. I added the PR.
Is it able to understand um a
blackboard? I don't know what it's
called in Atlas. Yeah.
>> A white board.
>> Maybe we're talking about a different
thing like a conbon board is not the
same as a whiteboard.
>> Oh, no, no, no, no, no,
>> no.
>> This supports everything except a
whiteboard and it it's really good and
but I do notice that sometimes it
struggles to do the markdown inside Jira
because Jirro markdown has always been
>> insane. I'm I I was very surprised
because I always struggle with Jira
markdown and then I see Cloud Sonnet or
Opus create Jira tickets and with all
theseh4 and all M's like what the hell
is that and and then it just creates the
tickets and I go oh that looks good.
>> Okay.
>> Okay. You need to share this skill with
me but I'm pretty happy. I
>> I asked a I asked Opus to highlight any
sensitive info and it was like um
enumeration of projects, enumeration of
of statuses, enumeration like don't
share this. I was like, "Okay, I won't
share it."
I was like, "Ai, can I open source
this?" And and and it was like, "No." I
was like, "Okay.
>> I don't even ask myself anymore."
>> Well, I I'm not too sure I've shared
this with you before, but I'm looking
forward to rewriting a lot of well, not
rewriting, just dumping Confluence to to
markdown.
>> Nice. And then I suppose just to make it
agent friendly
uh to to make it like goal orientated so
that uh
>> yeah so that the agents will know what
to do considering this this uh platform
that I'm working on is compated.
>> That's a big improvement.
>> It's going to be a massive improvement I
feel. um trying not to big it up too
much, but it's just it's just so nice to
work in a in a sensible way like with
markdown and uh being able to easily
edit things because just just the act of
edit updating documentation and
confluence is such a nightmare. I'm just
sick of it for me. Um right now my focus
is to maximize my output but also stay
reasonable healthy. So, I'm more of like
in the AI of Empire chart. I'm close to
the first group of I'm not I'm not
trying to burn out, but I'm trying to
achieve slightly more than what I would
be able to do if I was working full-time
uh myself. So, I'm trying to use AI to
to just hit more than what I my my
regular output, but not insane. Not like
10x um for for different
>> Yeah, I guess. And then I try to I try
to do this for the next few months
before I don't know organizations
>> every I'm feeling pretty ragged really
in uh
>> um though
I I'm I am sort of trying to take a step
back. I'm trying to be that uh force
multiplier where I I on board my
colleagues and and and with my learnings
of AI, you know, just simple stuff like
if we just put our documentation AI and
then reference that a that documentation
when we want something to be done, then
we'll get there in a more reliable
fashion. As for like building things,
I'm definitely not on your uh wavelength
at the moment just because
well,
>> I've taken a step back, I think, for the
last uh
>> Oh, that reminds me. I need to do that
blog.
>> I'll I'll do that. I'll do that blog
this morning.
>> SEO uh strategy.
>> So funny.
>> You should focus on CDKTF because I
think it's there is a need for it.
Actually, there is a need. Um
>> yeah, I I just spent a weekend Oh yeah,
doing well
>> brainstorming on how to incorporate
the L2 library. So I have Terra
constructs right but I feel the name is
too close to Terraform and and I feel
the CDK terrain should have its own L2
library. I I intend so terra constructs
is more like a it's more like a proof of
concept. It it shows that if you build
those L2 constructs and you can port
them from AW CDK it works really well.
And now I want to port that effort and
maybe start again but under a new name
which is aligned with with with CDK
terrain. So I was like brainstorming
names like what is the L2 concept? Is it
stratum?
>> You must have had some level twos in
there already somewhere. I just haven't
looked
>> in terrain.
>> Yeah.
>> Syndicate terrain
doesn't really do level twos, right? It
just does the init sorry it just does
the initial L1 bindings and then Terra
Construct is the full L2 library. And I
always wanted to keep them separate
>> cuz everyone has built their own.
>> Yeah, when I think about it, you're
right.
>> There's a few like there's there's the
concept of an archive. Um Oh, but you
asked me a question. You asked me about
like what is the difference between
CDKTF CLI and why would you run the CLI
versus running the same directly?
>> And I was going on about it's the asset
pipeline. It's the asset pipeline.
>> Yeah. And you were going to you're going
to show me how dumb I am about this.
You caught me in a bad time.
>> Well, okay. C can I just explain my my
problem just so that you just let me
just explain what I'm trying to do. We
have a whole bunch of CDK and I want to
refactor it so that
>> is it CDK AWS CDK.
>> Yeah, it's a CDK but I feel this is
>> a CDK a problem that h would probably
happen in CDKF whatever. So we we have
we have many business divisions. They
say there's 10 like it could be I don't
know HR,
commercial, whatever. Um, and each of
them has their own dev staging prod
and and with all these different
domains, there's lots of shared uh CDK
stacks and and and while we've been
bootstrapping them, we've been just
copying files across because SIM links
are unfortunately a dark art. Um, and
people don't want to use SIM links. So
we've been copying files and then over
time each file has been slightly changed
or got some wide space or what have you.
So we have like 10 sort of duplicated
CDK
uh apps I think is the correct term and
we want to dduplicate it. So but already
each each domain is quite complicated. I
wanted to create like a like a shared
library and then when I refactor some
stuff into a shared library that when I
do a CDK synth that I know it's the same
in a sense because one thing that bit me
with CDK refactoring is that I didn't
realize that at least in Python that if
you like put it in a different class
then the name changes because
>> Yeah.
>> I mean that caught me out. So basically
I'm having to rejig it again.
>> Yeah. But what I I I don't want I mean I
think
>> I think that will be
>> very difficult with with AWS CDK.
>> What I'm trying to do is not have all
these updates and deletes because I I
just hate hate doing that. So
>> So
basically I'm doing a CDK sent and I'm
like comparing it before and after to
make sure that my refactor is is is a
good idea.
>> Exactly. So yeah I see refactoring which
in terraform is a non-issue, right?
because you change it and then you just
put in a refactoring configuration and
it takes care of the logical ID changes.
What you just described is your logical
ID of the resources change but
physically the resources shouldn't
change. They shouldn't be deleted and
red recreated. Right?
>> Yeah. Yeah. What in terform I've seen
some people
>> because Terraform state is accessible
you can modify it. Cloud form is not.
They added a lot of
>> What do you mean like modify with an
import or something like that? What do
you
>> Yeah, you can like basically for me,
right, when I change my CDKTF
drastically and I get the problem that
you have, which is it's going to like
change all the logical identities. Yeah.
>> Um I I can I actually have a script that
reads um I have two.
>> I have one that reads the terapform plan
diff and sees what it's going to create
and what it's going to delete. It parses
out the resource type and the logic ID
and it tries to map them. If you have
one resource type, exactly one create,
one delete, it will map it one to one,
right? So say that's one that's that's
exactly the same one that you deleted
and created and it's going to generate a
move block for you. It's going to go if
you have three deletes and three
creates, it's going to sort them
alphabetically and try to map them and
say like those three they match. Most
likely these are the way that they
match. But maybe that's wrong. It's put
a big fat comment in the top says review
this because I could get this wrong. And
then the the one if it's asynchronous
like there's two deletes and there's uh
one create then one of them is deleted
one is kept. So which one do you want to
create? You have to valid validate that.
So that's what my Python script does
that I created with Opus like three
years ago. And you can do that very
easily with Terraform. Um you can parse
the plans you can generate those those
refactor blocks. If you do that with AWS
CDK it was three years ago very very
hard. I literally people usually just
delete the stacks and recreate them
because modifying a ter cloud for stack
is extremely hard but they did create a
whole bunch of refactoring tools around
cloud for that I never used in the last
oh this is interesting
>> I have no idea but yes there there's a
bunch of announcements around that um so
so this is where I would be looking if I
was you um if you need to do these
massive code refactoring and you can
also Google for people facing issues
with AWS cloud automation around uh and
CDK specifically about logical ids
because the moment you change things the
logic ID changes and then cloudformation
loses track of it and it says that
doesn't exist anymore.
>> I feel like an idiot. I I mean I've had
this problem for a while and I didn't
actually care to to do a basic AWS CDK
>> refactor
>> refactor search.
>> I said three years but it's from
September so it's not it's not just 10
months.
So this is the thing about cloud for
>> three years and AI.
>> Yeah. This is the problem with with with
cloud form playing catch up with
Terraform, right? I mean that's why I
convince people that I think CDKTF is
better than AWS CDK because these things
only come into AWS like in cloud form
now where Terraform started out with
these things. Well, not really. The
refactoring has only been there maybe
for four years.
>> Holy moly. Why didn't Why didn't I
bloody Google? Yeah, but but come back
to the reason why I was being so
annoying to you about the pipeline.
Um I can show you.
>> I don't get it. Just don't get it.
>> Yeah, I I'll show you what I think.
Maybe we'll explain it, but then I have
to go because I have another call. Um so
I'll just share this real quick. So um
can you see this like
>> Oh yeah. So what I'm doing here is a
comparison between CDKTF and AWS CDK
because a lot of people don't really
understand what's the difference between
them. Right? So AWS CDK and CDKTF they
both are a comment line interface and
one orchestrates terraform execution a
little bit and the other one
orchestrates cloud form right you will
agree to that right
>> both of them have L1 constructs so when
you use AWS CDK inside there's a whole
library of the L1 resources that are
directly the cloud for resources for
CDKTF you have the same thing you can
build the um L1 construct which are
basically one to one. So if you have
Terraform provider AWS, it has a
resource called AWS instance. There will
be an L1 construct called AWS inst or
just instance and you can use that to
create an AWS instance um configuration
block in terapform right the same thing
CFN resources they also have an L1. So
that's actually nothing special. Now the
big difference is that AWS CDK has an
advanced asset pipeline which includes
bundling. what the asset pipeline which
which sometimes I feel shouldn't be
there because it creates really annoying
divs but carry on
>> the asset pipeline does things like if
you have a lambda function and it needs
u python
>> it builds a layer and everything yeah
it's nice
>> it can do the layering it can package up
like if you have JavaScript or NodeJS
package JSON with dependencies it can
identify automatically that you're
deploying into a lambda layer or into a
lambda function runtime that supports
AWS SDK version 3 and it will make those
external. So when you bundle things up,
it's going to automatically make sure
that it doesn't bundle in the AWS SDK
for you. It does a lot of amazing
things. You get none of that in
Terraform world, right? Unless you build
it.
>> It could be more amazing. I feel like we
at work it we have a few stacks that
build a lot of lambda layers and and I
like I I don't maybe there's a trick,
but I would like to say like these
lambda layers are all effectively the
same. Can you just make them share
ahead?
>> Yeah. And if you look at to rebuild
everyone.
>> So, so there's an amazing open source
project from the AWS CDK team, uh, an
internal team at AWS that built the
construct hub. So, if you go to
constructs.dev or construct.dev, you can
see every single package on npmgs that
have constructs. If they are tacked and
licensed properly, they get
automatically indexed and they have a
nice documentation page made available.
So, this this hub thing, right, it runs
an a data ETL pipeline. And I think I
really have to go uh but that thing runs
a pipeline and it runs off bunch of step
functions and lambdas. And inside that
repo the if you go to the source code
you can actually see that they use
progen to generate a special lambda
function generator that then bundles the
code appropriately. So exactly what you
just said they build it in there.
>> Yeah. Progen is is a tool that that that
manages a it's like CDK for file
systems. So you can define a file
construct and you can define um
>> okay I'll have to have a look at well
thank well okay you have to go you have
to go so
>> so that that's the main difference AWS
CDK does CDK does so much more and CDKTF
does only the very basic it the asset
pipeline is actually it has the concept
of an archive but that's not bound to
like any provider because Terapform is
decoupled from AWS right so if you do
AWS CDK if you say an asset it will use
ECR S3 for you behind the behind the
scenes.
>> Yeah, I mean that could be that could be
a benefit because I do I do prefer basic
in a way. I do prefer zip files than
docker images.
>> You do until you don't you do until it's
done for you and then you say, "Oh my
god, I wish I had this sooner."
>> Yeah.
>> The trouble with zip files is that is
that Snick doesn't seem to like them or
whatever security bloody thing people
use.
>> Oh, then you just base 64, save them,
zip them again, 64 them, zip them again.
Then no security scanner will detect it.
Okay. All right. I I have to drop.
>> Okay. Thanks, Vincent. See you, man.
>> See you. Bye.
>> Uh well, it's just me and
I will publish as as a podcast. And if
you're listening to this podcast, thank
you and comment and like.
I wanted to remind you that if you got
this far, well, well done. though we
also do have summaries on debates.com
podcast
and uh yeah please comment please get in
touch if you like the podcast so we I
can keep on uh being motivated to get up
really early and and do it though at the
same time it's just great to chat with
Vincent and have an excuse to do that
because I'm always learning. I hope you
agree
um well that I'm learning and I hope
that you picked up something yourself.
Cool beans, have a great day. Have a
great week.
Get in touch.