Amazon Q Developer, CloudShell and AWS Amplify
Overview
Three developer-productivity tools appear in the DVA-C02 scope. Amazon Q Developer is a generative-AI assistant for coding that works in IDEs, the console and the CLI. AWS CloudShell is a browser-based shell with the AWS CLI preinstalled and credentials from your console session. AWS Amplify helps front-end and mobile developers build full-stack apps with hosting, auth, data and storage.
Think of them as a pair-programming partner (Q Developer), a ready-to-use workbench you open from the browser (CloudShell) and a starter kit that wires a website to a backend (Amplify).
You are tested on what each is for, and on safe usage: review generated code, keep secrets out of prompts and still apply least-privilege IAM.
Key Concepts
- Amazon Q Developer generates and explains code, suggests inline completions, writes unit tests, reviews code for security issues and helps troubleshoot AWS errors.
- Q Developer integrates with VS Code, JetBrains, Visual Studio, the AWS console, the CLI and command-line autocompletion.
- It can propose code transformations such as upgrading Java versions and run agentic coding tasks.
- CloudShell is free, browser-based, preloaded with AWS CLI, Python, Node.js and Git, with 1 GB of persistent home storage per Region.
- CloudShell uses the IAM permissions of the signed-in console identity; no keys to configure.
- Amplify Hosting deploys web apps from Git branches with a CI/CD pipeline and per-branch environments.
- Amplify Gen 2 defines backend (auth, data, storage, functions) in TypeScript, deployed through CDK.
- Generated code must be reviewed and tested like any other contribution.
Detailed Notes
Amazon Q Developer in practice
| Capability | Example use |
|---|---|
| Inline completion | Finish a boto3 function from a comment |
| Chat | Ask why a Lambda returns AccessDeniedException |
| Unit-test generation | Create pytest cases for an existing handler |
| Security scan | Detect hard-coded credentials and injection issues |
| Code explanation | Explain an unfamiliar CloudFormation template |
| Transformation | Upgrade Java 8 projects to newer versions |
A good prompt states language, service, constraints and a desired output. For example: "Write a Python Lambda handler for API Gateway proxy events that validates a JSON body and writes to DynamoDB using conditional writes." Review the result for least-privilege IAM, error handling, retries and logging. Do not paste secrets or customer data into prompts. Amazon Q Developer Pro offers administrative controls, and your data is not used to train the underlying models in the Pro tier.
# Prompt in IDE: "pytest for handler() with a mocked DynamoDB table using moto"
import json, boto3
from moto import mock_aws
from app import handler
@mock_aws
def test_creates_item():
boto3.client("dynamodb", region_name="eu-west-1").create_table(
TableName="orders", BillingMode="PAY_PER_REQUEST",
KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}],
AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}])
resp = handler({"body": json.dumps({"pk": "A1"})}, None)
assert resp["statusCode"] == 201
AWS CloudShell
Open it from the console toolbar. It runs in a managed Amazon Linux environment, authenticates with your current console identity, and lets you run aws, sam, git, python and npm. Files in $HOME persist for up to 1 GB per Region; everything else resets after a session ends. It is perfect for quick experiments or runbooks where you do not want local credentials, and it can be placed in a VPC for private resources.
aws sts get-caller-identity
aws lambda invoke --function-name hello --payload '{"name":"dev"}' \
--cli-binary-format raw-in-base64-out out.json && cat out.json
AWS Amplify
| Part | Purpose |
|---|---|
| Amplify Hosting | Git-connected CI/CD and global hosting for SPAs and SSR frameworks |
| Amplify Gen 2 backend | TypeScript definitions for Cognito auth, AppSync/DynamoDB data, S3 storage, Lambda functions |
| Amplify libraries | Client SDKs for web and mobile (Auth, API, Storage) |
| Amplify Studio / console | Manage branches, environment variables and previews |
Each Git branch can become its own deployment. A main branch maps to production while feature branches get preview URLs, which supports the exam topic of approved versions per environment. Build settings live in amplify.yml.
version: 1
frontend:
phases:
preBuild:
commands: [npm ci]
build:
commands: [npm run build]
artifacts:
baseDirectory: dist
files: ['**/*']
cache:
paths: [node_modules/**/*]
Choosing among them
Use Amplify when a front-end team wants a fast full-stack path and is happy with its opinionated services. Use CloudFormation, SAM or CDK directly for general infrastructure, and CodePipeline for broader multi-service release flows.
Real World Example
A small product team with two front-end engineers used Amplify Hosting to build every pull request into a preview URL and promote main to production, with Cognito auth and a DynamoDB-backed data model defined in TypeScript. The same engineers use Amazon Q Developer to draft Jest tests and to explain IAM errors, and run one-off data fixes in CloudShell so no one stores production credentials on laptops.
Architecture Diagram
Git pushes trigger builds that deploy a front end and its backend per branch.
- 1A developer pushes to a branch.
- 2Amplify detects the change and runs the build defined in amplify.yml.
- 3The backend (Cognito, data, functions) is deployed for that branch environment.
- 4The front end is published behind the CDN at a branch URL.
Best Practices
- ✓Review and test all AI-generated code, especially IAM policies and input handling.
- ✓Never paste secrets or personal data into AI prompts.
- ✓Use CloudShell for ad-hoc commands instead of storing long-lived keys locally.
- ✓Map Amplify branches to environments and keep production behind a protected branch.
- ✓Store environment-specific values in Amplify environment variables or secrets, not in code.
Common Interview Questions
Exam Tips
DVA-C02 focus
- 'Generate unit tests or explain code in the IDE' points to Amazon Q Developer.
- 'Browser-based CLI with no credential setup' is CloudShell.
- 'Front-end developers need hosting plus auth and data quickly' is Amplify.
- Amplify branch deployments illustrate environment management for different stages.
Finished this lesson?
0 of 46 lessons done · 0% of the course

