Accelerating Development with Amazon Q Developer
Amazon Q Developer is AWS's coding assistant, and its edge is context: it knows your AWS environment and shines at the unglamorous, high-value work — upgrading dependencies, migrating frameworks, generating tests, and answering "how is this deployed?" This chapter covers where an AWS-native assistant earns its keep.
Learning objectives
- Use Amazon Q Developer in the IDE and CLI.
- Explain its AWS-native edge (infra, docs, security scans).
- Use it for code transformation and AWS troubleshooting.
- Position it in a team's tool mix.
code/ad4-amazon-q/ in the course, with a README on how to run it. Read here, run there — no need to copy-paste.1 · Q Developer's edge essential
Picture two assistants staring at the same line of code. You ask both, "why is this Lambda timing out?" A general coding assistant reads your function and offers plausible guesses about the code. Amazon Q reads the same function and already knows it's a Lambda, knows Lambdas have a hard timeout ceiling, knows your function's configured limit, and knows the IAM role it runs under. One is guessing from the text on screen; the other is answering from the environment the code actually lives in. That difference — context — is the whole reason to reach for an AWS-native tool.
Here's the mental model that keeps you honest about when Q wins. Every AI coding assistant is strong on general programming, because they all trained on roughly the same public code. Where they diverge is on the specialized, proprietary-shaped knowledge — the exact name of an IAM action, the right CDK construct, which service limit bites at scale, how your account's resources are wired together. That knowledge isn't well-represented in generic training, and no amount of "read my open file" fixes it. Q's edge is that AWS built it around that knowledge: it's trained on and connected to AWS services, docs, and best practices, and it can see your account. So the size of its advantage is directly proportional to how much of your work is genuinely AWS-specific. On an all-AWS infrastructure team it's large; on a team writing generic app logic with a sprinkle of S3, it nearly vanishes.
The common mistake is treating "AI coding assistant" as one interchangeable category and expecting Q to be uniformly better (or worse) than the rest. It isn't — it's sharper on a narrower blade. Use it for the AWS-shaped questions a general assistant can only guess at, and don't be surprised when it's merely on par for everyday editing. Keep that framing as you read the rest of this chapter: everything below — the CLI, code transformation, security scans — is a specific place where "it knows your AWS environment" turns into concrete time saved.
Amazon Q Developer is AWS's coding assistant, and its edge is deep AWS knowledge: it knows the SDKs, IAM, service limits, and your account's resources. For AWS-heavy work it answers questions a general assistant can't — and it plugs into the IDE, CLI, and the AWS console.
Start at the top box — one question asked of both assistants — then follow the two arrows down to the two side-by-side panels comparing what each one can actually see.
- The top box is the identical prompt ("why is this Lambda timing out?") handed to both tools — the inputs are the same on purpose.
- The left blue panel is the general assistant: its inner box shows it sees only the open file, so the dashed grey arrow (a weaker link) leads to "plausible guesses."
- The right green panel is Amazon Q: its inner box lists the extra AWS context it can see — the timeout limit, the IAM role, the service limits — so the solid blue arrow leads to "answers from the account." That green panel is the payoff: the environment, not the model, is what makes the answer concrete.
In short: same code and same question in; different context available — and Q's edge is only as large as the slice of your work that is genuinely AWS-shaped.
2 · Where it shows up essential
A tool you can't reach is a tool you won't use. The reason this section matters isn't that the surfaces are complicated — it's that where an assistant lives quietly decides whether it gets used at all. An assistant buried in a web page you have to go visit gets forgotten; one that appears inline while you type, or answers in the terminal you already have open, becomes a reflex. Amazon Q meets you in the four places AWS work actually happens, and knowing which surface fits which moment is the difference between "I have Q installed" and "Q is part of how I work."
The useful way to read the table below is not as four separate products but as one assistant wearing four hats for four moods of work. When you're writing code, you want completions and a chat that understands the file — that's the IDE plugin. When you're operating — poking at resources, recalling a command — you don't want to leave the terminal, so the CLI (q) is the fit. When you're investigating in the AWS console ("what even is this resource and why is it configured like this?"), Q answers from the console's context. And when you're hardening, the security scan reviews for vulnerabilities. Same brain, different doorway.
One honest caveat as you scan it, so you don't over-trust any single row: each surface is a convenience layer, not an authority. The CLI proposes commands, it doesn't run them behind your back; the security scan is a first pass, not a sign-off; the console explanations are a helpful narration, not a guarantee. The value is that Q is present at the moment you need it — but you stay the reviewer at every surface. Read the table as "here's where Q shows up," and mentally append "…and here's where I still check its work" to every entry.
| Surface | Use for |
|---|---|
| IDE plugin | inline completions, chat about AWS code |
| CLI (`q`) | ask questions, translate intent → shell |
| Console | explain resources, troubleshoot from context |
| Security scan | find + auto-fix vulnerabilities |
Start at the purple box on top — that is Amazon Q itself — then follow each arrow down to the four surface it appears on, reading left to right.
- The purple box at the top is the single assistant; the four boxes below are not separate tools but the surfaces it wears — the label on each names the mood of work it fits.
- The four blue arrows all originate from the same box, making the point visually: one brain reaches you in the IDE (writing), the CLI (operating), the console (investigating), and the scan (hardening).
- The amber box on the right — the security scan — is coloured differently because it is a review pass rather than an authoring surface: it flags, it does not sign off.
In short: pick the surface by what you are doing, not by which "product" it is — it is one Q behind all four doorways.
3 · Intermediate — CLI intent-to-command intermediate
Be honest: how many times have you known exactly what you wanted from the AWS CLI and still lost ten minutes to the flags? You want "list S3 buckets over a gig in us-east-1," and instead you're three tabs deep in documentation reconstructing the incantation of subcommand, --query JMESPath, and region flag. The aws CLI is enormous and its syntax is unforgiving — the intent is trivial, the spelling is the tax. Intent-to-command exists to delete that tax: you say what you mean in English, and Q hands back the command that means it.
The mental shift here is subtle but important, so name it plainly: Q is turning the CLI from something you must recall into something you can recognize. Recall is hard — you have to produce the exact flags from memory. Recognition is easy — you read a proposed command and check that it does what you meant. That flip is why this feels so much faster than it sounds: you were never bad at knowing what you wanted, only at remembering how to spell it, and recognizing a correct command is a skill you already have. Q also explains errors with your account's context, so a cryptic AccessDenied becomes "this role is missing this action," which is recognition again — you confirm the diagnosis rather than reverse-engineer it.
Now the mistake that will bite you, and it's the whole reason this stays an "intermediate" skill rather than a beginner one. The convenience tempts you to run whatever Q proposes without reading it — to treat intent-to-command as intent-to-execution. Don't. Q knows your account, which means the commands it suggests can touch real resources; a generated command that looks right but targets the wrong region, the wrong account, or mutates instead of reads is a genuine incident waiting to happen. The verification habit is non-negotiable: read the command before you run it — confirm the region, confirm the account, and confirm it's read-only if you meant it to be. Q proposes; you dispose. In the lab below, notice the pattern: Q suggests, and a human confirms before anything executes. That confirm step isn't ceremony — it's the line between a helpful assistant and an unsupervised one with your credentials.
Read left to right: your plain-English intent flows into Q, Q hands back a proposed command, and then everything funnels through the amber "you confirm" gate before anything can run.
- The blue box on the left is what you say in ordinary words; the purple box is Q turning that intent into a concrete
awscommand — it only proposes. - The amber "you confirm" box is the load-bearing element: it is where you check the region, account, and that the command is read-only. Both outgoing paths pass through it.
- The solid arrow up to the green "run it" box is the happy path once you have verified; the dashed arrow down to "edit / reject" is the unhappy path that loops back to Q — nothing executes until you approve.
In short: the arrow into "run it" never fires on its own — the confirm gate is what keeps a generated command from touching the wrong resource.
q_cli.sh# Ask Q to translate intent into a command (it proposes, you confirm):
q chat "list S3 buckets larger than 1 GB in us-east-1"
# Inline: Q suggests the aws-cli invocation, you review, then run:
aws s3api list-buckets --query "Buckets[].Name"
This shows the two ways Amazon Q helps you at the terminal. The q command is the Amazon Q CLI — you type what you want in plain English, and Q figures out the AWS command for you. It proposes the command; nothing runs until you confirm. That safety step matters, because Q knows your AWS account and can suggest commands that touch real resources.
- Any line starting with
#is a comment — a note for humans that the shell ignores. It's here to explain the line below it. q chat "list S3 buckets larger than 1 GB in us-east-1"asks Amazon Q a question in ordinary words. Q replies with the exactawscommand that does this, so you don't have to remember the flags. You read it, then decide whether to run it.aws s3api list-buckets --query "Buckets[].Name"is the kind of command Q would hand back.aws s3apitalks to the S3 service;list-bucketslists your buckets; and--query "Buckets[].Name"filters the reply down to just the bucket names instead of the full details.
What the output means: Running the second line prints a list of your S3 bucket names, one per line. The first line (q chat …) doesn't change anything — it only suggests a command for you to review.
Try this: Ask Q something in your own words, like q chat "how do I see which EC2 instances are running?", and compare the command it proposes to what you'd have written by hand.
4 · Advanced — code transformation advanced
Every engineer has met the migration from hell. The framework you're on hit end-of-life; a library dropped support for the version you pinned; the whole codebase has to move from Java 8 to Java 17. There's nothing hard about any single file — you know the change — but there are four hundred of them, and doing it by hand is four hundred rounds of the same tedious edit, punctuated by the occasional surprise. It's the kind of work that's too mechanical to be interesting and too voluminous to be quick. This is exactly the shape of problem code transformation was built to eat.
Here's why this is Q's standout feature and not just a bigger autocomplete. Most AI coding help operates at the scale of a function or a file — you're in one spot, it helps you there. Code transformation operates at the scale of the whole repository: it plans the change, applies edits across every affected file, and reports what it did, as one coordinated pass. Think of the difference between asking a helper to fix one sentence versus handing them a manuscript with the instruction "update every citation to the new style." The second only makes sense if the task is genuinely mechanical and repeatable — and that's the sweet spot. When the change is uniform and large, an agent that touches every file beats a human touching every file, because your job shrinks from doing the edit to reviewing it.
And that reframing is the entire economic argument, which the lab below makes concrete with a small ROI calculator. The saving doesn't come from Q being smarter than you — it comes from converting hours-per-file of manual editing into minutes-per-file of review. Do the arithmetic across hundreds of files and the percentage saved is enormous. But — and this is the common trap that turns a triumph into a 2 a.m. incident — a transformation that passes tests is not a transformation that preserved behavior. Automated edits are blind to semantic drift: a dependency quietly changing a default timeout, a serialization format, a timezone, a rounding rule. Your green test suite proves "nothing broke that we already test for," not "nothing changed." So the review minutes in that ROI model aren't a formality you can shave to zero — they're where the safety lives. Push review time up and the savings shrink; push it to zero and you've automated your way into risk. The skill at this level is choosing the review depth that keeps the payoff and your production system standing.
Compare the two rows split by the dashed line: the top row is the manual world, the bottom row is the same migration with Q.
- The top row of small "edit" boxes (×400) is doing the migration by hand — the same mechanical edit repeated across every file, each costing hours.
- Below the dashed divider, the purple box is Q applying one repo-wide edit pass, and the blue arrow leads to the green box: you review rather than type. That is the whole shift — from doing to reviewing.
- The green "you review" box is the payoff and the caution: the note on its right marks review as "minutes per file — where the safety lives." Push those minutes to zero and you automate away the catch for semantic drift.
In short: the ROI comes from turning hours of editing into minutes of review — but the review is the safety net, not overhead to shave.
roi.pydef migration_roi(files, manual_hours_per_file, q_review_min_per_file):
manual = files * manual_hours_per_file
with_q = files * (q_review_min_per_file / 60) # you review Q's output
saved_pct = round(100 * (manual - with_q) / manual)
return {"manual_hours": manual, "with_q_hours": round(with_q, 1),
"saved_pct": saved_pct}
print(migration_roi(files=200, manual_hours_per_file=1.5, q_review_min_per_file=10))
{'manual_hours': 300.0, 'with_q_hours': 33.3, 'saved_pct': 89}
This little program answers a manager's question: is it worth using Amazon Q to migrate a large codebase? "ROI" means return on investment — here, how much time you save. The idea: doing each file by hand takes hours, but with Q you mostly just review its work, which takes minutes. The function adds both up and compares them.
def migration_roi(files, manual_hours_per_file, q_review_min_per_file):defines a reusable calculation. The three inputs are: how many files, how long each takes by hand (in hours), and how many minutes you'd spend reviewing Q's output per file.manual = files * manual_hours_per_fileis the all-by-hand total: files times hours each.with_q = files * (q_review_min_per_file / 60)is the with-Q total — but review time is in minutes, so/ 60converts it to hours first so the two numbers can be compared fairly.saved_pct = round(100 * (manual - with_q) / manual)works out the percentage of time saved: the gap between the two totals, as a share of the manual total, rounded to a whole number.- The function
returns a dictionary (a set of labelled values) with the two hour totals and the percentage. The last lineprint(migration_roi(files=200, …))calls it with real numbers — 200 files, 1.5 hours each by hand, 10 minutes review each — and prints the result.
What the output means: {'manual_hours': 300.0, 'with_q_hours': 33.3, 'saved_pct': 89} means: doing it by hand would take about 300 hours, doing it with Q about 33 hours — a 89% time saving. That's the case for letting Q do the mechanical work while a human reviews.
Try this: Change q_review_min_per_file to 30 (slower, more careful review) and re-run. Watch saved_pct drop — this shows the payoff shrinks the more hand-review you insist on.
5 · Professional — security scanning & guardrails professional
The most dangerous thing a security scanner can give you is a clean report. Not because the report is wrong, but because of what your brain does with it: a green checkmark whispers "you're secure now," and you relax. That false confidence is a bigger risk than the tool catching nothing at all, because at least an engineer who knows they haven't checked stays wary. So before we say a word about what Q's scanner does, hold this: a scan that finds nothing is not a system that's safe — it's a system where the obvious mistakes are absent. Those are very different claims.
Here's the honest picture of what a scanner like Q's can and can't see, because the boundary is the whole point. It's excellent at patterns — hard-coded secrets, injection-prone string handling, known-vulnerable dependency versions, insecure defaults. These are mistakes with a recognizable shape, and a machine scanning fast and broad across your whole repo will catch them more reliably and tirelessly than a human reviewer skimming at 5 p.m. But it is essentially blind to anything requiring an understanding of your intent: business-logic flaws, broken authorization, an endpoint that lets user A read user B's data (IDOR), design-level issues about where your trust boundaries sit. Think of it as a spell-checker for security — brilliant at "this word is misspelled," useless at "this sentence, though perfectly spelled, is a lie." You would never call a document true because it passed spell-check.
The professional-level skill, then, is wiring the scanner in so it helps without lying to you. The move is to treat it as one layer with a clearly-bounded job: run it in CI as a gate for the obvious — block a merge on a hard-coded secret or a high-severity finding, because those are exactly the mechanical mistakes it's good at. Then deliberately keep human review for the things it can't see: auth and authorization changes, and design review for any new data flow. And tune the noise on purpose — a scanner that cries wolf with false positives trains your team to click past it, which is worse than not having it, because now you've automated the ignoring of security warnings. Frame it to everyone as "this catches the careless mistakes so our review can focus on the subtle ones" — never as "the security step is done." One more thing that lives at this tier and nowhere else: mind what code and context leaves your environment when the assistant runs, and check the enterprise/data-handling tier before you point it at sensitive repos.
Read the two coloured panels side by side — green is what the scanner can see, red is what it cannot — then the amber bar underneath is how you wire that split into a workflow.
- The green "Catches" panel lists pattern-shaped mistakes: secrets, injection-prone code, vulnerable dependencies, insecure defaults. These have a recognizable shape, so a machine catches them fast and broadly.
- The red "Blind to" panel lists intent-shaped flaws — broken authorization, IDOR, business-logic errors — that need an understanding of your trust boundaries, which only a human reviewer supplies.
- The amber bar spanning both is the payoff: gate CI on the obvious (green) while deliberately keeping human review for the subtle (red) — never treat a green scan as "security is done."
In short: green = pattern (automate the gate), red = intent (keep the human) — a clean scan means the obvious mistakes are absent, not that the system is safe.
6 · Tech-lead — right tool for the AWS-heavy team tech-lead
The instinct when you're leading a team is to standardize — pick one assistant, roll it out, done. It feels clean, it simplifies procurement, it gives everyone the same muscle memory. And for AI coding tools it's usually the wrong instinct, because it forces a single answer onto a question that genuinely has different answers for different work. The lead's job here isn't to crown a winner; it's to route. This section is about the judgment that comes after you've understood Q's edge, its surfaces, and its limits: how do you actually place it in a real team's day?
The organizing principle is the one from section 1, now used as a decision rule: an assistant's advantage is proportional to how specialized the task is. So route by where the edge is real. The AWS-shaped work — IAM policies, CDK and CloudFormation, service configuration, translating intent into aws CLI — goes to Q, because that's the narrow blade where it beats a generic assistant. The general-shaped work — application logic, tests, everyday refactors — goes to whatever general assistant or editor your team already likes, because there Q is at parity, not ahead. This is why the honest framing is complements, not competitors: you're not asking "Q or Copilot?", you're asking "which of these two, for this task?" A polyglot team with a slice of AWS will run both without contradiction.
But routing by capability is only half the design; the other half is guardrails sized by blast radius — and this is the part that separates a lead from a power user. Not all AI-generated output is equally dangerous. A wrong line of application logic fails a test and you fix it. A wrong IAM policy or a bad infrastructure change can take down a service or open a hole across the whole account. So the rule is: put the tightest review on the highest-blast-radius output. Read every generated CLI and IaC change; let nothing destructive run unseen; give the credentials Q operates with least-privilege scope; and standardize a plan-diff step (like cdk diff) before any infrastructure apply, because infra mistakes propagate. Then measure the thing you actually care about — infra-change lead time, misconfiguration incidents — so "we adopted Q" becomes "provisioning got faster and wrong-IAM incidents dropped," a claim you can defend to your own leadership. Pick the tool per task by where the edge truly is; guard hardest where a mistake hurts most.
Start at the top box — a task arriving — and follow the one-question split, then look down each column to see how tightly its output is guarded.
- The top box asks the only routing question that matters: is the task AWS-shaped? The solid arrow (yes) sends it left to Amazon Q; the dashed arrow (no) sends it right to a general assistant. That is "complements, not competitors."
- The left green box is Q's real edge — IAM, CDK, service config,
awsCLI. The right blue box is where Q is only at parity, so a general assistant is fine. - The bottom row sizes the guardrail to the danger: the red box (IAM / infra output) gets the tightest review and a plan-diff before apply because its blast radius is widest; the plain box (app logic) only risks a failing test you then fix.
In short: route by where the edge is real, and put the strictest review on the output that can hurt the whole account.
Exercise AD4.1 — Cost a migration
Context: Framework and version migrations are mechanical, voluminous, and a strong ROI fit for Q — but the payoff depends on keeping the right human review in the loop so automation stays safe.
Your task: Pick a real or hypothetical framework/version migration, estimate manual vs Q-assisted effort, and list the human review you'd keep.
Requirements:
- Use
roi.pyto estimate manual vs Q-assisted effort for the migration - List the specific human review steps you'd keep in the loop to keep the automation safe
- Acknowledge the trade-off that more per-file human review shrinks the automation payoff
- Balance safety against the ROI you're chasing rather than maximizing either alone
💡 Hint: The ROI comes from Q doing the mechanical work while humans only review per file — the review minutes you insist on directly size the savings.
🪜 Practice ladder beginner → industry
Six graded exercises, easy to real-world. Try each before opening its solution.
Context: Amazon Q Developer's distinctive edge is deep AWS integration, and knowing exactly where that edge is real (and where it disappears) is what lets you position it against a generic assistant.
Your task: In two sentences, state Amazon Q Developer's distinctive edge over a generic AI coding assistant and the kind of team it matters most for.
Requirements:
- Name the edge: deep AWS integration (trained on and connected to AWS services, docs, best practices)
- Give AWS-specific examples where it beats a generic assistant (IAM policies, CDK/CloudFormation, service config, intent-to-
aws-CLI) - Say it matters most for AWS-heavy teams doing daily provisioning/config/ops
- Note the edge mostly disappears for teams with little AWS surface
💡 Hint: The edge is proportional to how much of the team's daily work is actually AWS-specific.
Show solution
Q Developer's edge is deep AWS integration: it is trained on and connected to AWS services, docs, and best practices, so it is strongest at AWS-specific tasks — writing IAM policies, CDK/CloudFormation, service configuration, and translating intent into correct aws CLI commands — where a generic assistant guesses.
That edge matters most for AWS-heavy teams whose daily work is provisioning, configuring, and operating AWS infrastructure; for a team with little AWS surface, the edge mostly disappears.
Context: Q can turn intent into a shell command, which is great for recalling syntax — but intent-to-command demands a verification habit, because you own confirming it does what you meant and nothing destructive.
Your task: Show the before/after for ‘list all S3 buckets over 100 GB’ and name the verification habit that must accompany it.
Requirements:
- Show the intent and the shape of command Q produces (buckets have no direct size field, so it composes CloudWatch metrics or an S3 inventory query)
- Note the command needs AWS credentials to run
- Name the verification habit: read the command first — confirm region, account, and that it is read-only
- State the rule: never pipe a generated command straight into execution unseen
💡 Hint: Intent-to-command is for recall of syntax, not for trust — read it before you run it, especially for anything that could mutate.
Show solution
Intent: ‘list all S3 buckets larger than 100 GB.’ Q translates this to a CLI invocation (buckets have no direct size field, so it composes CloudWatch metrics or an S3 inventory query):
# conceptual shape Q produces (needs AWS credentials to run):
aws cloudwatch get-metric-statistics \
--namespace AWS/S3 --metric-name BucketSizeBytes \
--dimensions Name=BucketName,Value=<bucket> Name=StorageType,Value=StandardStorage \
--start-time ... --end-time ... --period 86400 --statistics AverageVerification habit: read the command before running it — confirm the region, the account, and especially that it is read-only. Intent-to-command is great for recall of syntax, but you own confirming it does what you meant and nothing destructive. Never pipe a generated command straight into execution unseen.
Context: Large code transformations (like a Java version upgrade across a repo) are Q's standout use case — but a bulk change demands bulk-appropriate verification: a snapshot, per-module review, and a test suite that defines correctness.
Your task: Describe how you'd run and verify a large Q code transformation (e.g. a repo-wide version upgrade) safely.
Requirements:
- Scope & snapshot: run on a branch off a clean commit so the transformation is one reviewable, revertible diff
- Review the diff by module, not as one unreviewed blob
- Lean on the test suite as the definition of correctness; add characterization tests first if coverage is thin
- Watch for semantic changes (deprecated APIs swapped for ones with subtly different behavior) — diff behavior, not just syntax
- Stage the rollout incrementally rather than a big-bang cutover
💡 Hint: The tool saves the typing; the test suite and a staged rollout supply the verification the bulk change demands.
Show solution
- Scope & snapshot: run on a branch off a clean commit so the whole transformation is one reviewable, revertible diff.
- Let it transform, then read the diff by module — don't accept a repo-wide change as a single unreviewed blob; review file groups.
- Lean on the test suite: a version upgrade's correctness is defined by tests still passing. If coverage is thin, add characterization tests before transforming.
- Watch the semantic changes — transformations sometimes swap deprecated APIs for ones with subtly different behavior (e.g. default time zones, null handling). Diff behavior, not just syntax.
- Stage the rollout: merge and deploy incrementally where possible rather than a big-bang cutover.
The transformation saves the typing; the test suite and staged rollout provide the verification the bulk change demands.
Context: A Q-run upgrade that passed all tests but broke production exposes the gap between ‘no logic break’ and ‘no behavior change’ — a dependency's changed default that the tests never asserted on.
Your task: Explain the likely gap when a Q-run dependency upgrade passed tests but caused a subtle production incident, and how to close it.
Requirements:
- Name the gap: tests covered code paths but not the behavioral change (a changed default — timeout, serialization, timezone, rounding)
- Explain that green tests prove ‘no compile/logic break’ not ‘no behavior change’
- Close it by reading the dependency changelog for behavior/default changes, not just API removals
- Add characterization tests pinning the specific behaviors prod relies on, before upgrading
- Canary the change and compare real outputs against the old version
- State the lesson: automated transformation is blind to semantic drift; verification must include behavior
💡 Hint: The transformation tool won't surface a dependency's changed default as a diff in your code — the changelog and characterization tests will.
Show solution
Likely gap: the tests covered the code paths but not the behavioral change the upgrade introduced — e.g. a library changed a default (timeout, serialization format, timezone, rounding) that the tests never asserted on. Green tests proved ‘no compile/logic break’ not ‘no behavior change’.
- Read the upgraded dependency's changelog for behavior/default changes, not just API removals — the transformation tool won't surface these as diffs in your code.
- Add characterization tests that pin the specific behaviors prod relies on (exact output formats, boundary values) before upgrading.
- Canary the change: ship to a small slice and compare real outputs against the old version.
Lesson: automated transformation moves fast on syntax but is blind to semantic drift in dependencies. Verification must include behavior, not just a green suite.
Context: Q's security scanning is a fast, broad first pass that catches careless mistakes — but a clean scan is not a secure system, and treating it as ‘done’ creates false confidence.
Your task: Explain what Q's security scanning does and does not catch, and how to wire it in without creating false confidence.
Requirements:
- What it catches: common patterns (hard-coded secrets, injection-prone code, known-vulnerable dependencies, insecure defaults) — a fast broad first pass
- What it misses: business-logic flaws (broken authz, IDOR), design-level issues, anything needing your trust boundaries
- Wire it into CI as a gate for the obvious (block on secrets and high-severity findings)
- Keep human security review for auth/authorization changes and design review for new data flows
- Tune out false-positive noise so the team doesn't learn to ignore the scanner
- Frame it as ‘catches careless mistakes so review focuses on subtle ones’, never ‘security is done’
💡 Hint: Position the scanner as one layer that frees human review to focus on the logic and design flaws it can't see.
Show solution
What it catches: common patterns — hard-coded secrets, injection-prone code, known-vulnerable dependency usage, insecure defaults. It is a fast, broad first pass.
What it misses: business-logic flaws (broken authorization, IDOR), design-level issues, and anything requiring understanding of your trust boundaries. A clean scan is not a secure system.
- Run it in CI as a gate for the obvious — block merges on hard-coded secrets and high-severity findings.
- Treat it as one layer: keep human security review for auth/authorization changes and design review for new data flows.
- Tune out noise deliberately — unmanaged false positives train the team to ignore the scanner, which is worse than not having it.
Frame it to the team as ‘catches the careless mistakes so review can focus on the subtle ones,’ never as ‘the security step is done.’
Context: A platform team living in AWS should pick tools per task by where the training/integration edge actually is — Q where its AWS edge is real, a general assistant where it isn't — and put the tightest guardrails on the highest-blast-radius output.
Your task: You lead an AWS-heavy platform team (CDK, Lambda, IAM, EKS): decide where Amazon Q fits vs a general assistant and design the combined workflow.
Requirements:
- Route tasks by edge: Q for IAM/CDK/service-config and
awsCLI recall; general assistant/editor for general app logic, tests, refactors - Treat Q's security scan as a broad first pass paired with human review, not sufficient alone
- Guardrails first: read every generated CLI/IaC change, nothing destructive runs unseen, least-privilege credentials for Q
- Standardize IaC review (plan-diff, e.g.
cdk diff, before apply) because infra has blast radius - Measure the win (infra-change lead time, misconfig incidents)
- State the lesson: pick per task by where the edge is, and put the tightest guardrails on highest-blast-radius output (IAM/infra)
💡 Hint: They're complements, not competitors — and IAM/infra output gets the strictest review because its mistakes have the widest blast radius.
Show solution
Decision: use Q where its AWS edge is real, a general assistant where it isn't — they're complements, not competitors.
| Task | Tool | Why |
|---|---|---|
| IAM policies, CDK, service config | Amazon Q | AWS-trained; fewer wrong-shape guesses |
| aws CLI recall & ops one-liners | Amazon Q | Intent-to-command is its sweet spot |
| General app logic, tests, refactors | General assistant / editor | Not AWS-specific; parity or better |
| AWS security posture first pass | Q security scan + human review | Broad pattern catch, but not sufficient alone |
- Guardrails first: read every generated CLI/IaC change; nothing destructive runs unseen; least-privilege on the credentials Q operates with.
- Standardize IaC review: generated CloudFormation/CDK is reviewed and plan-diffed (e.g.
cdk diff) before apply — infra mistakes have blast radius. - Measure: track infra-change lead time and misconfig incidents; the win shows up as fewer ‘wrong IAM’ and faster provisioning.
Lesson: pick the tool per task by where the training/integration edge actually is, and put the tightest guardrails on the highest-blast-radius output (IAM and infra).
✓ Checkpoint — you can move on when you can…
- Use Q in the IDE and CLI.
- Explain its AWS-native advantages.
- Apply it to migrations; estimate ROI.
- Position Q vs general assistants per workload.
Knowledge check check yourself
The lesson calls code transformation Amazon Q's standout feature and pairs it with a migration_roi calculation. Why is this class of work such a strong fit for Q?
Show answer
Raising q_review_min_per_file in the ROI model shrinks saved_pct. What production trade-off does that illustrate about Q-assisted migrations?