← All lessons
AWS generative AI developer exam prep · Lesson 2 of 18

AWS and AI basics

The exam expects you to know AWS and generative AI already. If either is new, this lesson gives you the vocabulary; every service and idea here comes up again in the later lessons.

AWS basics. Everything you build lives in an AWS account and runs in a Region, a geographic area such as us-east-1 (Virginia) with its own data centres; data stays in the Region you pick unless you send it elsewhere. Every resource has an ARN (Amazon Resource Name), a unique id like arn:aws:s3:::my-bucket. Programs call AWS through APIs, usually with an SDK (a code library; for Python it's boto3). Serverless means AWS runs the servers and you pay per use; managed means AWS handles the upkeep of a service for you.

Who may do what: IAM (Identity and Access Management). A policy is a JSON document that allows or denies actions (like bedrock:InvokeModel) on resources. People and programs get permissions through roles: a Lambda function runs as a role, so it never needs a stored password. Least privilege means granting only what's needed.

Storage and data: Amazon S3 keeps files (objects) in buckets, and is where documents, datasets and logs usually live. Amazon DynamoDB is a fast key-value database, often used for chat history and session state. A VPC (virtual private cloud) is your own private network inside AWS; a VPC endpoint lets things in it reach an AWS service without going over the public internet. AWS KMS manages encryption keys.

Running code and connecting it: AWS Lambda runs a function when something triggers it, for up to 15 minutes, with no servers. Amazon API Gateway puts a managed HTTP API in front of your code. Amazon SQS is a queue that holds work until a worker takes it; Amazon SNS sends notifications; Amazon EventBridge routes events between services; AWS Step Functions runs a workflow of steps with retries and branches. Containers run on Amazon ECS. Amazon CloudWatch collects metrics, logs and alarms, and AWS CloudTrail records every API call for auditing.

AI words. A foundation model (FM) is a large model trained on broad data that can be used for many tasks; a large language model (LLM) is one that works with text. You send it a prompt, it replies, and both are measured in tokens (small chunks of text, about four characters of English each), which is what you pay for. The context window is the most tokens one request can hold. Inference is running a model to get an answer; temperature controls how varied the answer is. A hallucination is a confident answer that isn't true.

More AI words. An embedding is a list of numbers that captures a text's meaning, so similar texts get similar numbers; RAG (retrieval augmented generation) uses embeddings to find relevant passages and puts them in the prompt. Fine-tuning trains an existing model further on your own examples. An agent is a model that calls tools in a loop to finish a task. PII is personally identifiable information: names, emails, card numbers and anything else that identifies a person. Latency is how long a reply takes; throughput is how many requests can be served at once.

Practice

A Lambda function needs to read one S3 bucket. What's the right way to give it access?

More info

Quick reference

Region, ARNWhere resources run; a resource's unique id.
SDK, boto3Code libraries for calling AWS; the Python one.
IAM policy / roleJSON that allows actions; an identity code runs as.
S3, DynamoDBFile storage in buckets; a fast key-value database.
VPC, VPC endpoint, KMSYour private network; private access to a service; encryption keys.
Lambda, API GatewayServerless functions (15 min max); a managed HTTP API.
SQS, SNS, EventBridge, Step FunctionsQueue; notifications; event routing; workflows.
CloudWatch, CloudTrailMetrics, logs and alarms; a record of API calls.
FM, LLM, token, context windowA broad pretrained model; a text one; text pieces; most per request.
Embedding, RAG, fine-tuning, agentMeaning as numbers; retrieve then answer; further training; a model calling tools.
PII, hallucinationData that identifies a person; a confident false answer.

Related courses