AWS Province Primer
A working primer on the AWS stack behind a governed AI-agent deployment — IAM as inverted Unix permissions, Bedrock AgentCore, Lambda, S3, and a verified cost model — mapped to Linux and systemd concepts.
Topics: Data, Cloud & Platforms · AI Agents & Orchestration
An AWS account is a machine you don't own
Think of your AWS account as one big remote box: it has a filesystem (S3), a way to run code on demand (Lambda), a process supervisor (the managed runtimes), logs (CloudWatch), and a permission system (IAM). Two differences from your Linux box change everything downstream:
- Everything is an API call. There is no shell at the bottom — creating a bucket, invoking a function, reading a log are all authenticated HTTPS calls. The console website and the
awsCLI are both just clients for the same API. - Everything has a name (ARN) and a bill. Every resource gets an Amazon Resource Name like
arn:aws:s3:::leebase-evidence/runs/*, and every action is either free-tier or metered. The province design's rule — nothing bills while idle — is enforced by only using services that scale to zero.
Regions: you pick one (us-east-1) and everything lives there. Resources in different regions can't see each other by default — for the province this is a feature: one region, one stack, no accidental sprawl.
Identity is Unix permissions, inverted
On Linux, a process inherits the permissions of the user who started it. In AWS, nothing has permissions until a policy grants them — deny by default, everywhere. Four words carry the whole system:
- Principal — who is acting: you (an IAM user/identity), or a service (a Lambda function, an AgentCore runtime).
- Policy — a JSON document of allow statements: this action, on this resource. Like a sudoers file, but per-API-call and per-ARN.
- Role — a wearable identity: a bundle of policies that a principal assumes. Your closest analog is a service account. Services don't have passwords; they wear roles.
- Trust policy — the half people miss: each role also declares who is allowed to wear it. A role is two documents: who may assume it, and what it may do.
SigV4 is how a human or program proves identity on a raw HTTPS call: every request is cryptographically signed with your access key. You'll never implement it — the aws CLI and SDKs do it — but "IAM-authenticated function URL" means "only correctly signed requests get in," which is how the gate's approve endpoint knows it's you.
AccessDenied. It is almost never a bug — it is the deny-by-default doing its job. Read it as: which principal, attempting which action, on which ARN? Then find the missing allow statement. This replaces an entire genre of Linux permission archaeology.Six services, each mapped to something you run
| AWS | Your analog | What the province uses it for |
|---|---|---|
| S3 | A remote filesystem-shaped object store | The evidence tree, runs/-shaped, exactly like local. Objects are immutable-by-replacement; later, Object Lock makes them immutable outright (Phase 3). Read it with aws s3 sync + cat. |
| Lambda | A socket-activated systemd unit, billed per 100ms | The three gate functions. Zero processes when idle, cold-starts in ~100–300ms on demand. The always-free tier (1M requests/mo) swallows portfolio volume ~7,000× over. |
| ECR | A private Docker registry | Holds the one container image the AgentCore runtime runs. Build locally, docker push, done — script it as one make target. |
| AgentCore Runtime | Your bwrap sandbox, upgraded | Runs the agent loop in a Firecracker microVM per session — hardware-level isolation, destroyed and memory-sanitized after each session. Notably: it has the network isolation your bwrap setup documents as not-built. This is an honest security upgrade over the Factory local tier. |
| CloudWatch | journald + a metrics daemon | Every Lambda print statement lands here automatically. Free tier covers the province; you'll mostly read it via aws logs tail --follow. |
| SSM Parameter Store | A config directory with IAM on it | The few config values (bucket name, runtime ARN, model rates). Free at standard tier. Secrets Manager exists for real secrets but the province barely needs one. |
The run lifecycle, end to end
The invariant you'll demo: employee-contract verify s3://… passes on the same tree layout as local — and corrupting one artifact byte fails at the right entry. Evidence semantics survive the substrate change; that's the whole thesis in one command.
Why AWS went first
Where the AWS cents actually go
The five things that actually bite newcomers
- Idle-billing services. The province uses none, but the moment anyone suggests a NAT Gateway, an Application Load Balancer, or a provisioned database, the $0-idle property dies. The design's answer to "should we add X?" starts with "does X have an hourly meter?"
- IAM wildcards.
"Resource": "*"works and is how tutorials go fast. The province's roles name exact ARNs and prefixes — slower once, safe forever. Hold any AI-generated infrastructure to that standard in review. - Region drift. A resource created in the wrong region "disappears" (it's just in the other region). One region, set in the deploy script, checked in the make target.
- Credential hygiene. Long-lived access keys in dotfiles are the AWS equivalent of passwords in shell history. Use
aws configure ssoor short-lived keys; the Lambda and Runtime never hold keys at all — they wear roles. - The bill lags. Cost Explorer runs ~24h behind. Check it the day after the first governed runs — make the day-after check part of your definition of done — and set a $10 billing alarm on day one — it's free and turns surprise into email.
Enough terms to supervise any AWS conversation
| Term | Meaning in one line |
|---|---|
| ARN | The absolute path of any resource: arn:aws:service:region:account:name. |
| Principal | Whoever is making the API call — a person or a service wearing a role. |
| Execution role | The role a Lambda/Runtime wears while running; its only source of permissions. |
| Trust policy | The half of a role that says who may wear it. |
| SigV4 | The request-signing scheme; "IAM-authenticated" means "SigV4-signed by an allowed principal." |
| Function URL | A plain HTTPS endpoint on a Lambda — the gate's front door, IAM-auth mode, no API Gateway needed. |
| Firecracker microVM | The lightweight VM AgentCore boots per session — stronger isolation than a container, destroyed after use. |
| Object Lock | S3's write-once mode; Phase 3 turns the evidence bucket into storage the operator cannot rewrite. |
| Cost Explorer | The billing dashboard; check it the day after any new deployment. |
| CloudFormation / Terraform | Infrastructure-as-code; the province ships as one small stack so a client can audit and delete it wholesale. |