Domain 4: Operating, Monitoring, and Securing ML and AI Solutions (Part 2 of 2)
This lesson covers 3 exam topics: Managing ML and FM Costs, Access Control, IAM and FM Credentials, Network Isolation, Auditing and Safeguards. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Managing ML and FM Costs
Central question: Where does the money go, and how do you cap and cut it?
Cost tools (general background)
AWS Cost Explorer (analyse spend), AWS Budgets (alerts and thresholds), cost allocation tags (by team, project, model), AWS Cost Anomaly Detection, Service Quotas to cap usage.
FM cost in production (skills 4.2.7, 4.2.9; verified Bedrock items)
| Lever | Effect |
|---|---|
| Model size / routing | Smaller models for simple tasks; intelligent prompt routing |
| Prompt caching | Cheaper repeated prefixes |
| Batch / Flex | ~50% lower for work that can wait |
| Provisioned throughput | Only for steady load |
| Response limits, context pruning | Fewer tokens |
AI-specific cost patterns (skill 4.2.10)
- Token usage: per feature and team (CloudWatch token metrics).
- Embedding computation: re-embedding everything after small changes is wasteful; embed incrementally; batch embedding jobs.
- Vector storage: choose the store by query rate (S3 Vectors for low-QPS, cost-optimized storage); lower dimensions or binary vectors reduce storage (verified: binary vectors cost less but are less precise).
Exam traps
- Re-embedding the whole corpus for a few changed documents.
- No budgets or tags, so nobody knows which team spends what.
- Provisioned throughput for bursty traffic.
2. Access Control, IAM and FM Credentials
Central question: Who and what can touch models, data and endpoints — and with which credentials?
Least privilege for ML artefacts (general background plus guide)
- Separate execution roles per training job, endpoint, pipeline and notebook user.
- Scope S3 access to specific prefixes; KMS key policies for encrypted artefacts.
- Restrict
sagemaker:CreateEndpoint, model registry approval andbedrock:InvokeModelto the roles that need them; scope to model ARNs. - Use condition keys (e.g. VPC, tags) to enforce network and project boundaries.
Bedrock credentials (skill 4.3.8; verified)
| Credential | Lifetime | Use |
|---|---|---|
| IAM credentials (roles) | Temporary STS credentials | Default for applications and services |
| Short-term Bedrock API key | Up to 12 hours (or session); inherits the IAM principal's permissions | Recommended for production use of API keys |
| Long-term Bedrock API key | Until a set expiry; creates an IAM user | Exploration only |
API calls are logged in CloudTrail; API keys travel as authorization headers and are not logged.
Exam traps
- Long-term API keys in production.
- One admin role shared by every ML component.
- Hard-coded keys in notebooks or containers (use roles or Secrets Manager).
3. Network Isolation, Auditing and Safeguards
Central question: How do you isolate, audit and protect ML and AI workloads end to end?
Network isolation (skill 4.3.6; verified where linked)
- Run training and endpoints in private subnets of your VPC (VpcConfig; two AZs for hosting).
- Security groups restrict traffic; VPC endpoints (PrivateLink) for SageMaker and Bedrock; S3 gateway endpoint.
- Network isolation mode for training containers blocks outbound calls (general background).
Pipeline and image security (skill 4.3.1; verified)
- Amazon Inspector scans ECR container images and Lambda functions for vulnerabilities.
- Amazon CodeGuru Reviewer analysed code for defects and secrets — it stopped accepting new repository associations on November 7, 2025; use Inspector code scanning or other tools for new setups.
Auditing and compliance (skill 4.3.4; verified)
AWS CloudTrail (who called which API), AWS Config (resource configuration history and rules, e.g. "endpoints must use KMS"), CloudWatch Logs, Bedrock model invocation logging (off by default).
Risks and troubleshooting (skills 4.3.5, 4.3.7; design guidance)
Common issues: AccessDenied from missing role permissions or KMS key policy; endpoints failing to pull artefacts without an S3 endpoint; public buckets (Macie, Config rules); prompt injection and data leakage in GenAI apps.
Safeguards (skill 4.3.9; verified)
Amazon Bedrock Guardrails: content filters (incl. prompt attack), denied topics, word filters, sensitive information filters (mask PII), contextual grounding and Automated Reasoning checks; ApplyGuardrail for non-Bedrock models.
Exam traps
- Endpoints with public internet access when the requirement is isolation.
- Recommending CodeGuru Reviewer for new repositories.
- Logging prompts with raw PII instead of masking.
References
- MLA-C02 Domain 4 — checked Oct 19, 2026
- Bedrock pricing — checked Oct 19, 2026
- Prompt caching — checked Oct 19, 2026
- S3 Vectors — checked Oct 19, 2026
- How KBs work (binary vectors) — checked Oct 19, 2026
- Bedrock API keys — checked Oct 19, 2026
- SageMaker in a VPC — checked Oct 19, 2026
- Amazon Inspector — checked Oct 19, 2026
- CodeGuru Reviewer — checked Oct 19, 2026
- AWS Config — checked Oct 19, 2026
- Bedrock Guardrails — checked Oct 19, 2026
Check your understanding
Alert when ML spend passes $10,000 this month?Show answerHide answer
Answer
AWS Budgets.Production app needs a Bedrock API key?Show answerHide answer
Answer
Short-term key (or IAM role credentials).Scan container images in ECR?Show answerHide answer
Answer
Amazon Inspector.Attribute costs per project?Show answerHide answer
Answer
Cost allocation tags.Training job should read only one S3 prefix?Show answerHide answer
Answer
Execution role scoped to that prefix.