Posts

The Secret Life of AWS: The Serverless Coding Mindset

Image
  The Secret Life of AWS: The Serverless Coding Mindset # aws # python # coding # cloud Stop writing code for servers. How to shift your mindset from "Linux Heavy" to "Serverless Lite". Part 22 of The Secret Life of AWS Timothy was typing furiously. He was building a Lambda function to process the "Order Events" from Episode 20. Margaret stopped by to review the code. She raised an eyebrow. The file was 400 lines long. "Timothy," she asked gently. "What is all this?" "It is robust code," Timothy said proudly. "Look here: I created a  ThreadPool  to handle multiple records. Then I added a  RetryLoop  with exponential backoff in case the database is busy. And here, I am managing a connection pool to the database." "So...you are writing code for a Server," Margaret said. "But there is no server." "You are treating AWS Lambda like a tiny Linux box," she said quietly. "You are trying to ...

The Secret Life of AWS: The Workflow (AWS Step Functions)

Image
  The Secret Life of AWS: The Workflow (AWS Step Functions) # aws # stepfunctions # devops # cloud Orchestration vs. Choreography. How to use AWS Step Functions to manage complex workflows. Part 21 of The Secret Life of AWS Timothy was staring at a Python script that was scrolling endlessly on his screen. "What are you building?" Margaret asked, pausing by his desk. "I am writing the Return Process," Timothy said. "It is complicated. First, I have to credit the user's wallet. Then, I have to update the inventory. Then, I need to wait 24 hours to send a 'We're Sorry' email." Margaret leaned in closer to read the code. She pointed to line 45. time.sleep(86400) # Wait 24 hours "Timothy," she asked gently. "Where is this code running?" "On AWS Lambda," he replied. "Lambda functions have a maximum execution time of 15 minutes," she reminded him. "If you tell this function to sleep for 24 hours, it wil...

The Secret Life of JavaScript: The Shadow (Hoisting)

Image
The Secret Life of JavaScript: The Shadow (Hoisting) # javascript # coding # programming # softwaredevelopment Understanding the Temporal Dead Zone and the Compile Phase. Timothy was staring at his monitor, confused. He had written a function at the bottom of his file, called it at the top, and it worked. But when he tried to log a variable the same way, it crashed. // This works? sayHello (); // This crashes? console . log ( framework ); function sayHello () { console . log ( " Hello! " ); } let framework = " React " ; "It makes no sense," Timothy said. "Does JavaScript read from the top down or not?" Margaret picked up a piece of chalk. "It does both," she said. "You are confusing the  Execution Phase  with the  Compile Phase ." The Two Passes Margaret drew a timeline on the board. "The JavaScript Engine does not just run your code immediately," she explained. "It makes two passes over you...

AWS Bedrock Error: 'ServiceQuotaExceededException' Persists After Approval

Image
  AWS Bedrock Error: 'ServiceQuotaExceededException' Persists After Approval # aws # bedrock # devops # cloud A diagnostic guide for resolving continued Bedrock quota errors after an AWS quota increase has been approved. Problem You receive confirmation from AWS that a Bedrock quota increase has been  approved , but invocations still fail with: ServiceQuotaExceededException: The request exceeds the service quota. Typical symptoms: The quota request shows  Approved  in Service Quotas Errors persist unchanged after approval Retries and backoff do not help IAM, model access, and payload are correct Clarifying the Issue This is  not  a throttling problem and  not  a failed quota request. It occurs when the  approved quota is not being applied to the execution context actually making the request . The most common causes are: Region mismatch  (approved in one region, invoked in another) Propagation delay  between approval and enforcement ...