By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Study Guide for Data Engineers & ML Practitioners
Amazon Q and CodeWhisperer are AI-powered developer tools that accelerate ML workflows by automating code generation, debugging, and infrastructure-as-code (IaC) tasks. In an ML pipeline, they reduce manual effort in: - Writing boilerplate code (e.g., SageMaker training scripts, Lambda functions for preprocessing). - Debugging errors in distributed training jobs or API deployments. - Generating IaC templates (e.g., CloudFormation for SageMaker endpoints, IAM policies). - Explaining complex ML concepts (e.g., hyperparameter tuning strategies, model evaluation metrics).
Real-world scenario: A data scientist at a fintech company is building a fraud detection model using SageMaker. They use CodeWhisperer to auto-generate Python code for feature engineering (e.g., rolling window statistics) and Amazon Q to debug a failing training job by analyzing CloudWatch logs and suggesting fixes (e.g., adjusting batch size or GPU memory limits). Later, they ask Amazon Q to generate a CloudFormation template to deploy the model as a real-time endpoint with auto-scaling.
Best practices (e.g., "How do I secure a SageMaker endpoint with VPC and IAM?").
Amazon CodeWhisperer (AI-powered code generator): A real-time code completion tool (like GitHub Copilot) trained on AWS-specific code (e.g., Boto3, SageMaker SDK). It:
Integrates with IDEs (VS Code, JetBrains, AWS Cloud9).
AWS Toolkit for VS Code: A VS Code extension that provides:
Debugging tools for AWS services (e.g., stepping through Lambda code).
SageMaker SDK: The Python library for interacting with SageMaker services (e.g., sagemaker.estimator.Estimator). CodeWhisperer can auto-generate SDK code for:
sagemaker.estimator.Estimator
fit()
HyperparameterTuner
Model deployment (deploy()).
deploy()
Boto3: The AWS SDK for Python. CodeWhisperer can generate Boto3 code for:
s3.put_object
glue.start_crawler
Step Functions workflows (sfn.start_execution).
sfn.start_execution
Infrastructure as Code (IaC): Automating AWS resource provisioning using templates (e.g., CloudFormation, CDK). Amazon Q can:
Explain CDK constructs (e.g., sagemaker.CfnModel).
sagemaker.CfnModel
AWS CLI: Command-line interface for AWS. Amazon Q can:
aws sagemaker create-model
Debug CLI errors (e.g., "Why is my aws s3 cp failing with AccessDenied?").
aws s3 cp
CloudWatch Logs: AWS’s logging service. Amazon Q can:
InProgress
Suggest fixes (e.g., "Increase instance size for OOM errors").
IAM Policies: Permissions for AWS services. CodeWhisperer can:
Flag overly permissive policies (e.g., s3:*).
s3:*
SageMaker Pipelines: AWS’s ML orchestration service. Amazon Q can:
ProcessingStep
TrainingStep
ConditionStep
us-east-1
train.py
# Load data from S3 into a Pandas DataFrame
Tab
s3.get_object
Ctrl+Enter
FileNotFoundError
AlgorithmError
ml.m5.large
ml.m5.xlarge
AWS::SageMaker::EndpointConfig
ProductionVariants
AWS::ApplicationAutoScaling::ScalableTarget
python from sagemaker.workflow.steps import TuningStep tuning_step = TuningStep( name="HyperparameterTuning", tuner=tuner, inputs={"train": train_input, "validation": val_input} )
Condition
PropertyFile
Metadata
cfn-lint
cdk synth
sagemaker.pytorch
"A developer wants to debug a failing Lambda function. Which tool should they use?"
Integration with AWS Services:
Know how Amazon Q and CodeWhisperer interact with:
Security and Compliance:
Amazon Q’s least-privilege IAM suggestions (e.g., "How can a developer generate a secure IAM policy for a Lambda function?").
Cost and Limits:
A data scientist is writing a SageMaker training script in Python but is stuck on implementing a custom loss function. Which AWS service can auto-generate the code for them? - A) Amazon Q - B) CodeWhisperer - C) SageMaker Autopilot - D) AWS Lambda
Answer: B) CodeWhisperer Explanation: CodeWhisperer generates real-time code suggestions for ML tasks, including custom loss functions in PyTorch/TensorFlow.
A developer deployed a SageMaker endpoint, but it’s failing with ModelError. They want to analyze CloudWatch logs and get suggestions for fixes. Which tool should they use? - A) AWS CloudTrail - B) Amazon Q - C) AWS X-Ray - D) SageMaker Debugger
ModelError
Answer: B) Amazon Q Explanation: Amazon Q can analyze CloudWatch logs and suggest fixes for SageMaker errors (e.g., instance size, IAM permissions).
A team wants to generate a CloudFormation template for a SageMaker endpoint with auto-scaling. Which service can create this template with minimal manual effort? - A) AWS CDK - B) Amazon Q - C) AWS CloudFormation Designer - D) CodeWhisperer
Answer: B) Amazon Q Explanation: Amazon Q can generate IaC templates (CloudFormation/CDK) for AWS services like SageMaker.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.