DAILY NEWS

Stay Ahead, Stay Informed – Every Day

Advertisement
CDK Deploy-Twice: When Your Infrastructure Needs to Know About Itself



There is a moment that catches a lot of people out who are new to AWS CDK. You deploy a service, the deploy succeeds, and then you realize the service cannot fully configure itself because it did not know its own endpoint until after it was running.

This is not a CDK bug. It is a genuine chicken-and-egg problem, and once you understand it, the solution is straightforward-ish.

The problem

Some resources only exist after CloudFormation has provisioned them: ALB endpoints, service URLs, and auto-assigned DNS names. These values are not known at the cdk synth time. They are outputs that come back after the stack deploys.

If your application needs to know its own public URL (e.g., to build redirect links), well then, you are in a kerfuffle. You cannot pass a value into the stack that the stack itself has not produced yet. CloudFormation is not psychic, so unfortunately neither is CDK (I hear AI is working on this, though).

What it looks like in practice

Here is a real example from my latest YouTube tutorial video. This is a URL shortener that needs BASE_URL to construct the short links it returns, but BASE_URL is the service’s own endpoint, which CloudFormation only assigns after the ECS service and ALB are provisioned.

The CDK stack handles this with tryGetContext:

const baseUrl = this.node.tryGetContext(‘baseUrl’) as string | undefined;

const environment = (
{ name: ‘TABLE_NAME’, value: table.tableName },
{ name: ‘AWS_DEFAULT_REGION’, value: this.region },
);

if (baseUrl) {
environment.push({ name: ‘BASE_URL’, value: baseUrl });
}

Enter fullscreen mode

Exit fullscreen mode

And the endpoint is exported as a stack output:

new cdk.CfnOutput(this, ‘ServiceEndpoint’, {
value: service.attrEndpoint,
description: ‘Re-deploy with –context baseUrl= to wire BASE_URL’,
});

Enter fullscreen mode

Exit fullscreen mode

tryGetContext returns undefined if the value was not passed in, so deploy one works fine. It simply runs without BASE_URL set. Deploy two wires it in. Therefore, two deploys, one working service, zero existential crises.

The deploy pattern

Deploy 1: provision the infrastructure, get the endpoint:

cdk deploy EcsExpressStack

Enter fullscreen mode

Exit fullscreen mode

Deploy 2: pass the endpoint back in as context:

SERVICE_URL=$(aws cloudformation describe-stacks \
–stack-name EcsExpressStack \
–query “Stacks(0).Outputs(?OutputKey==’ServiceEndpoint’).OutputValue” \
–output text)

cdk deploy EcsExpressStack –context baseUrl=$SERVICE_URL

Enter fullscreen mode

Exit fullscreen mode

Why this is not a CDK bug

CDK synthesizes a CloudFormation template before anything is deployed. At synth time, late-bound values like ALB endpoints exist only as CloudFormation tokens, which are placeholders that resolve later. You can use them within the same stack (they resolve correctly in the template), but you cannot read them back into your TypeScript logic during synth. This is because the template has not run yet, and therefore the value does not exist yet. This is simply the correct order of operations.

tryGetContext sidesteps this. You supply the value externally on a subsequent deploy, once CloudFormation has resolved it.

When you will run into this

A service that builds URLs pointing to itself
A resource that needs its own ARN or DNS name as a config value
Cross-stack references where stack B’s input is stack A’s output and you have not wired them through CfnOutput and Fn.importValue

The pattern feels a little awkward the first time. It stops feeling awkward once you understand why it works that way. Then starts feeling awkward again when you dust off that old forgotten side project (you know, that one).

So which came first: the service or the endpoint?

The endpoint… but only after the service… which needed the endpoint to configure itself… which required the service to exist first.

At this point, I recommend not thinking about it too hard.



Source link

The Journey Begins: Week 1 as an Aspiring Data Professional.


Introduction

‎Ladies and gentlemen, I believe in this era of social media, we have all come across content that encourages us to ‘Awaken the beast within’. Up until a week ago, I thought that it is only us humans that contained a beast that needed awakening. Shock on me when I discovered that machines too, specifically computers/laptops, harbor a beast of their own: Microsoft Excel.

For those already familiar with Excel, you already know what I am talking about. If you happen to fall under this category, a newbie alert is hereby issued: you may relax, take a back seat, and sip your juice. For the rest of the newbies like myself, buckle up your Excel belt and get ready to explore.‎‎

Excel and its use cases.

‎Picture yourself as a local food chain supplier with all kind of assorted food items stored in a certain warehouse. The catch? Your stock is scattered everywhere. The moment you step inside the warehouse, an overwhelming sense of confusion weighs down on you. To get on top of things and excel (pun very much intended), you would definitely have to hire some people to come and do the arrangement and sorting of the food items in a manner that restores order.

‎Excel is the equivalent of the people you hire to bring order into our imaginary warehouse. It is basically a tool that helps you interact with numerical data in a more meaningful and impactful way. Excel helps you in data management, offering a wide range of functionalities at your disposal, ranging from collecting, organizing and analyzing of data, to calculation and effective visualization. Is data your problem? Excel is your solution.

‎Are you a small business owner wanting to keep track of your stock, sales and calculate profits? Call Excel. Are you a large financial institution looking towards managing your income statement and gain insights on your revenue growth? Call Excel. Are you a medical institution and want to make sense of your patient records? Call Excel. Are you in the hospitality industry and need to learn your client trends so that you can offer better services? Call Excel. Is your home being robbed? You’d better call 911 as Excel won’t be coming to your rescue.‎

‎‎Excel Features and Formulas.

‎The past one week has been one full of new discoveries in Excel. Let me paint you a picture.

‎Assume that I am the class teacher of Form 4 West at Excellent High School. Students have just completed their exams and the results are out. Before working on the data, I would first ensure that it clean by ensuring correct formats are followed. For example, in the name column, I would use the PROPER function to ensure the student names are in the correct format. I would then check for duplicates in the data and remove them if they exist.

‎Once done with the cleaning l, would then dive deep into analysis, starting off by average performance of the class. This would be achieved by the AVERAGE function in the column ‘Overall grade” by typing =AVERAGE (range). To identify the top-performing student, the MAX function does the job: =MAX (range). Conversely the MIN function to know the worst performing student. By now I believe you have are starting to get the hang of it.

Beyond these basics, Excel also offers powerful tools like IF statements for flagging conditions (for example, automatically marking students who scored below 50 as “At Risk”). Each formula unlocks a new layer of what the data is trying to tell you.‎‎

Conclusion

‎My first week of learning Excel has left me excited and eager, like a kid in a candy store. It is often said that numbers never lie and that they do tell a story. Left to their own devices, numbers remain just that: numbers, and so does data. Excel is what transforms raw data into stories, and for every story told, there is impact made.

Let’s go and Excel!‎



Source link

A 120B-model laptop, a federal AI bill, and free pro-grade editing: 3 shifts for builders



Three things landed at once that change what you can run, ship, and edit on your own machine. Here’s the builder’s-eye view, with what (if anything) to do today.

1. Nvidia RTX Spark Superchip — a 120B-model PC on your desk

Nvidia unveiled the RTX Spark Superchip, a Windows-on-Arm platform: 20 Arm cores paired with a Blackwell GPU over NVLink, and 128GB of unified memory — enough to run 120B-parameter models with a 1-million-token context locally. Over 30 laptops, including a Surface Ultra, arrive in the fall.

Why it matters for builders: local big-model development stops being a server-rack thing. If you’ve been renting GPU time just to prototype against large models, the math changes this fall. Don’t rebuild your rig yet — wait for the actual hardware and benchmarks before you spend.

Source: https://www.tomshardware.com/laptops/nvidia-unveils-rtx-spark-superchip-at-computex-2026-new-platform-promises-to-turn-windows-into-an-agentic-ai-os-with-arm-cpu-blackwell-gpu-and-128gb-unified-memory

2. The Great American AI Act

Congress unveiled a 269-page federal bill that would freeze state AI-development laws for three years. Frontier developers would report safety incidents to the government, a new Commerce AI center gets 100 million dollars a year, and impersonating officials with AI becomes a federal crime. It’s still a draft.

Why it matters for builders: if you ship AI products in the US, one federal rulebook beats a 50-state patchwork. But it’s a draft, so expect a fight in Congress. This is one to track, not act on yet.

Source: https://fedscoop.com/bipartisan-great-american-ai-act-draft-proposes-new-federal-ai-governance-framework/

3. DaVinci Resolve 21 — free pro editing + 8 AI tools

Blackmagic shipped DaVinci Resolve 21, adding a new Photo page (a direct Lightroom rival) plus eight AI tools like Magic Mask, UltraSharpen, and Face Age — mostly available in the free version.

Why it matters for builders: if you make thumbnails, demos, or launch videos solo, studio-grade photo and AI editing is now a free download. Pull it down and test the Photo page on your next thumbnail.

Source: https://www.cined.com/davinci-resolve-21-final-release-now-available-new-photo-page-expanded-ai-toolset-krokodove-in-fusion-and-wide-raw-support/

That’s the short version. I run a daily AI-news-for-builders short — full video here: https://www.youtube.com/shorts/SMKIl5TD-y8



Source link