S3 Directory Bucket Deployer
What this skill does
Provisions S3 Express One Zone directory buckets and S3 Tables table
buckets with correct naming, zone placement, and compute co-location.
The skill walks an 8-step procedure, surfaces the silent-failure modes
unique to directory buckets (most dangerous: the directory bucket name
format is base-name--az-id--x-s3 and any deviation silently creates a
standard bucket or fails; compute deployed in a different AZ pays
cross-AZ data-transfer fees and loses the latency benefit; table
buckets have a different API surface than general-purpose buckets and
standard S3 commands silently no-op), and emits a READY_TO_DEPLOY
checklist verifying every item against actual state. The single most
common incident this skill prevents: an operator creates a directory
bucket, deploys EC2 in the "same region," but a different AZ — the
latency profile looks like standard S3 and cross-AZ transfer charges
accumulate silently because the directory bucket's performance benefit
is only realized within its single AZ.
Quick navigation
| Section | What it covers | When to read it |
|---|---|---|
| Quick reference | Provisioning summary (8 steps), verdict thresholds, dependency graph | Before any operation |
| Activation keywords | Phrases that route to this skill | Disambiguating routing |
| Invocation contract | Required literal labels in the response | Formatting the response |
| Reasoning framework | Why the 8-step order matters; AZ ID vs AZ name semantics | Understanding the deploy model |
| Dependency graph | Which configs silently no-op without their prerequisite | Debugging "no latency benefit" |
| Expert heuristic | The zone-mismatch trap; name format parsing; table bucket API divergence | Pre-empt production incidents |
| Prerequisites | What to verify before emitting any command | Avoid PREREQUISITES_MISSING rework |
| 8-step procedure | The actual provisioning with copy-pasteable CLI | Executing the deploy |
| NEVER (top 5) | Hard rules that prevent silent exposure / data-plane bugs | Review before deploy |
| STRICT output contract | Required DIRECTORY_BUCKET_SPEC / VERDICT / CHECKLIST / VERIFICATION_COMMANDS block | Formatting the response |
| Recent AWS features | S3 Tables integration, AZ ID targeting, zone-optimized compute | Stay current |
Quick reference — provisioning summary (8 steps)
→ Provisioning summary moved to references/provisioning-cli-commands.md (loads on demand); the 8-step procedure below remains canonical.
Activation keywords
S3 directory bucket, S3 Express One Zone, directory bucket name format, AZ ID, Availability Zone ID, zone affinity, zone-optimized compute, table bucket, S3 Tables, Apache Iceberg on S3, single-digit millisecond latency S3, directory bucket limitations, create-directory-bucket, base-name--az-id--x-s3, Zonal endpoint, S3 Express One Zone pricing, directory bucket no CRR, directory bucket no versioning.
Invocation contract (hard requirement)
When this skill is invoked with an S3 directory bucket or table bucket
provisioning request, the agent MUST respond with the checklist defined
in §"STRICT output contract" using the literal all-caps labels
DIRECTORY_BUCKET_SPEC:, VERDICT:, CHECKLIST:, and
VERIFICATION_COMMANDS:. Do NOT preface the checklist with prose,
headings, or disclaimers — emit the block as the first lines of the
response. This contract is what assertion-based evals and downstream
provisioning pipelines rely on; deviating from the literal labels
breaks automation silently.
Reasoning framework (why the provisioning order matters)
S3 Express One Zone directory buckets look like "a faster S3 bucket." The underlying model has four traps:
The bucket name IS the AZ selector. Directory bucket names follow the rigid format
base-name--az-id--x-s3(double-dash delimited). Theaz-idsegment (e.g.,use1-az1) is the Availability Zone ID, not the AZ name (us-east-1a). Operators who use the AZ name or omit the--x-s3suffix get a creation error or, worse, fall back tocreate-bucketand silently create a standard general-purpose bucket with none of the Express One Zone benefits.Zone affinity is the entire value proposition. A directory bucket exists in exactly one AZ. Compute in the same AZ gets single-digit-millisecond latency and the highest requests-per-second throughput. Compute in a different AZ of the same region pays cross-AZ data-transfer fees ($0.01/GB in each direction) and loses the latency advantage — the workload performs no better than standard S3 but costs more per request.
Table buckets use a separate API. S3 Tables table buckets (for Apache Iceberg) are a specialized directory bucket type created via
aws s3tables create-table-bucket, notaws s3api create-directory-bucket. Operators who use the wrong API either get a plain directory bucket (no table semantics) or an error.The limitations are hard, not soft. Directory buckets do not support cross-region replication, versioning, Object Lock, Transfer Acceleration, or cross-Region endpoints. An operator who assumes these "just work" discovers the gap when a compliance audit fails or a DR runbook produces an empty bucket.
Dependency graph (silent-failure table)
| Configuration | Hard dependencies (API error without) | Silent failure mode (returns 200, does nothing) | Enables downstream |
|---|---|---|---|
| Directory bucket name format | AZ ID resolved; --x-s3 suffix |
operator falls back to create-bucket → standard bucket created, no error, no Express benefit |
correct bucket type |
create-directory-bucket API |
name format valid; AZ ID exists | operator uses create-bucket → general-purpose bucket silently, no Express One Zone performance |
Express One Zone tier |
| Zone-affinity compute | EC2/ECS/EKS in same AZ as bucket | compute in different AZ → cross-AZ transfer fees + no latency benefit; no error surfaced | single-digit-ms latency |
| Zonal endpoint | directory bucket exists | client uses regional endpoint → request routes through regional S3, adds latency overhead; no error | optimal routing |
| Table bucket (S3 Tables) | s3tables API; Iceberg format |
operator uses create-directory-bucket → plain directory bucket, no table semantics; or create-bucket → standard bucket |
Iceberg table operations |
| Bucket encryption | directory bucket exists | SSE-KMS key in wrong region → creation fails; SSE-S3 is default but some compliance requires SSE-KMS | encryption compliance |
| Bucket policy | directory bucket exists; Zonal endpoint ARN format | policy uses standard bucket ARN format → matches nothing; AccessDenied regardless of intent | client scoping |
| Cross-region replication | NOT SUPPORTED | operator configures CRR → API silently ignores or errors with unclear message; DR gap | N/A — use app-level replication |
The four silent-failure rows are the ones a baseline model misses.
Wrong API (create-bucket instead of create-directory-bucket), zone
mismatch, regional endpoint routing, and wrong policy ARN format all
produce successful-looking operations with no Express One Zone benefit.
This is why the procedure verifies every item rather than trusting the
API response.
Expert heuristic: the zone-mismatch trap
→ Moved to references/advanced-patterns.md — zone-mismatch trap full detail.
Expert heuristic: the name format parser
→ Moved to references/advanced-patterns.md — name format parser full detail.
Expert heuristic: table bucket API divergence
→ Moved to references/advanced-patterns.md — table bucket API divergence full detail.
Prerequisites (verify before provisioning)
Before emitting any provisioning command, verify these prerequisites. If any are missing, the verdict is PREREQUISITES_MISSING with a specific gap citation.
| Prerequisite | Why it matters | How to verify |
|---|---|---|
| AZ ID resolved (or AZ name available to resolve) | The bucket name encodes the AZ ID; wrong AZ = no benefit | aws ec2 describe-availability-zones --zone-names <AZ_NAME> --query 'AvailabilityZones[0].ZoneId' |
| Base bucket name (no double-dash) | Double-dash in base name collides with the format parser | manual validation |
| Region supports S3 Express One Zone | Not all regions support Express One Zone | aws s3api list-buckets --region <REGION> (no error) |
| Compute placement plan (same AZ) | Zone affinity is the entire value proposition | aws ec2 describe-subnets --filters Name=availability-zone-id,Values=<AZ_ID> |
| KMS key in same region (if SSE-KMS) | SSE-KMS requires a key in the same region as the bucket | aws kms list-aliases --region <REGION> |
| Account ID | Required for bucket policy ARN construction | aws sts get-caller-identity --query Account --output text |
| No unsupported feature requirement | CRR, versioning, Object Lock are NOT supported | requirements review |
| Table bucket vs directory bucket decision | Table buckets use a different API surface | workload type (Iceberg = table bucket) |
If any prerequisite is missing, output VERDICT: PREREQUISITES_MISSING
and cite the specific gap.
8-step provisioning procedure
Step 1 — Resolve the AZ ID
The AZ ID (use1-az1) is account-specific and differs from the AZ name
(us-east-1a). Always resolve from the AZ name unless the operator
provides an explicit AZ ID.
# Resolve AZ ID from AZ name
aws ec2 describe-availability-zones \
--zone-names us-east-1a \
--query 'AvailabilityZones[0].[ZoneName,ZoneId]' --output text
# Output: us-east-1a use1-az1
# List all AZs in a region to pick the target
aws ec2 describe-availability-zones \
--region us-east-1 \
--query 'AvailabilityZones[].[ZoneName,ZoneId]' --output table
Common mistake: assuming us-east-1a always maps to use1-az1.
The AZ-name-to-AZ-ID mapping is consistent within an account but varies
across accounts. Always resolve programmatically.
Step 2 — Construct the directory bucket name
Assemble the name in the rigid base-name--az-id--x-s3 format.
BASE_NAME="my-app-data"
AZ_ID="use1-az1"
DIRECTORY_BUCKET="${BASE_NAME}--${AZ_ID}--x-s3"
echo "$DIRECTORY_BUCKET"
# my-app-data--use1-az1--x-s3
Validation checklist for the name:
- Base name contains NO double-dash (
--) - Base name is DNS-compatible (lowercase, alphanumeric, hyphens only)
- AZ ID is in the
xxxx-azNformat (e.g.,use1-az1,apne1-az2) - Suffix is exactly
--x-s3 - Total name length is within S3 bucket name limits
Common mistake: using a single dash (-) as the delimiter. The
API rejects single-dash names; operators who switch to create-bucket
get a standard bucket with no error.
Step 3 — Create the directory bucket
# S3 Express One Zone directory bucket
aws s3api create-directory-bucket \
--bucket my-app-data--use1-az1--x-s3 \
--data-redundancy SingleAvailabilityZone \
--region us-east-1
Common mistake: using aws s3api create-bucket. This creates a
general-purpose S3 bucket (standard tier) with NO Express One Zone
benefits. The operation succeeds silently. Always verify the bucket
type after creation with list-buckets --output json and check for the
BucketType: Directory field.
Step 4 — Configure encryption and bucket policy
# Default encryption (SSE-KMS)
aws s3api put-bucket-encryption \
--bucket my-app-data--use1-az1--x-s3 \
--server-side-encryption-configuration '{
"Rules": [{
"ApplyServerSideEncryptionByDefault": {
"SSEAlgorithm": "aws:kms",
"KMSMasterKeyID": "arn:aws:kms:us-east-1:111111111111:key/<KEY_ID>"
}
}]
}'
The bucket policy for a directory bucket uses the Zonal endpoint ARN
format (arn:aws:s3express:<region>:<account>:<bucket>), NOT the
standard S3 ARN format:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::<ACCOUNT>:role/<APP_ROLE>"},
"Action": ["s3express:GetObject", "s3express:PutObject", "s3express:ListBucket"],
"Resource": [
"arn:aws:s3express:<REGION>:<ACCOUNT>:<BUCKET>",
"arn:aws:s3express:<REGION>:<ACCOUNT>:<BUCKET>/*"
]
}]
}
Common mistake: using arn:aws:s3:::<bucket> (standard ARN) in the
policy. The policy matches nothing and clients get AccessDenied
regardless of intent. Directory buckets use the s3express service
prefix and Zonal endpoint ARNs.
Step 5 — Deploy or confirm zone-affinity compute
Pin compute to the same AZ as the directory bucket.
# Find subnets in the target AZ
aws ec2 describe-subnets \
--filters Name=availability-zone-id,Values=use1-az1 \
--query 'Subnets[].[SubnetId,AvailabilityZoneId]' --output table
# Launch EC2 in the same AZ
aws ec2 run-instances \
--image-id ami-<AMI_ID> \
--instance-type c7n.large \
--subnet-id subnet-<SUBNET_IN_AZ> \
--tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=zone-affinity-app}]"
For ECS/EKS, set the availabilityZone constraint on the node group or
task placement to match the directory bucket's AZ. For an EC2 Auto
Scaling Group, restrict subnets to the target AZ.
Common mistake: deploying compute "in the same region" without checking the AZ. The directory bucket exists in exactly one AZ; compute in any other AZ pays cross-AZ transfer fees and sees no latency benefit.
Step 6 — For table buckets: create via S3 Tables API
# S3 Tables table bucket for Apache Iceberg
aws s3tables create-table-bucket \
--name analytics-iceberg-tables \
--region use1-az1
# Create an Iceberg table inside the table bucket
aws s3tables create-table \
--table-bucket-name analytics-iceberg-tables \
--name events_iceberg \
--format ICEBERG \
--metadata '{"format-version":"2","write.ordering":"event_ts"}'
Table buckets do NOT support object-level operations (PutObject,
GetObject). They support table-level operations via the s3tables
API and integrations with Athena, Glue, Spark, and Trino for Iceberg
table access.
Common mistake: trying to use aws s3api put-object on a table
bucket. The operation fails because table buckets have a fundamentally
different API surface.
Step 7 — Configure application for Zonal endpoint
Directory buckets are accessed via Zonal endpoints, not regional endpoints. The AWS SDK and CLI auto-route when using the bucket name, but verify the endpoint:
# Verify the Zonal endpoint
aws s3api get-bucket-location \
--bucket my-app-data--use1-az1--x-s3
# Quick latency probe (should be single-digit ms from same-AZ compute)
time aws s3 ls s3://my-app-data--use1-az1--x-s3/ --region us-east-1
For application code using the SDK, ensure the S3 client does not override the endpoint to a regional endpoint. The SDK resolves the Zonal endpoint from the bucket name format automatically.
Step 8 — Verification
Run every verification command and confirm each output matches the expected state.
# Verify bucket type is Directory (not general-purpose)
aws s3api list-buckets --query 'Buckets[?Name==`my-app-data--use1-az1--x-s3`]' --output json
# Verify encryption
aws s3api get-bucket-encryption --bucket my-app-data--use1-az1--x-s3
# Verify bucket policy
aws s3api get-bucket-policy --bucket my-app-data--use1-az1--x-s3
# Verify compute is in the same AZ
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=zone-affinity-app" \
--query 'Reservations[].Instances[].[InstanceId,Placement.AvailabilityZone,Placement.AvailabilityZoneId]' \
--output table
# For table buckets: verify table exists
aws s3tables list-tables --table-bucket-name analytics-iceberg-tables
# Latency probe (from zone-affinity compute, should be single-digit ms)
time aws s3 ls s3://my-app-data--use1-az1--x-s3/ --region us-east-1
NEVER do these things
These anti-patterns cause silent performance loss, cost overruns, or compliance gaps. Each is observed in real production incidents — the "why it's wrong" line is the post-mortem finding.
NEVER use
create-bucketto create a directory bucket. Why it's wrong:create-bucketcreates a general-purpose S3 bucket in the standard tier with NO Express One Zone benefits. The operation succeeds silently. Always usecreate-directory-bucketwith--data-redundancy SingleAvailabilityZoneand verify theBucketType: Directoryfield after creation.NEVER deploy compute in a different AZ than the directory bucket. Why it's wrong: a directory bucket exists in exactly one AZ. Compute in any other AZ pays cross-AZ data-transfer fees ($0.01/GB each way) and sees 10x higher latency with no error surfaced. Pin compute to the bucket's AZ using subnet filtering or capacity reservations.
NEVER use a standard S3 ARN (
arn:aws:s3:::) in a directory bucket policy. Why it's wrong: directory buckets use thes3expressservice prefix and Zonal endpoint ARNs (arn:aws:s3express:<region>:<account>:<bucket>). A standard ARN matches nothing and clients get AccessDenied regardless of intent.NEVER assume directory buckets support standard S3 features. Why it's wrong: directory buckets do NOT support cross-region replication, versioning, Object Lock, Transfer Acceleration, or cross-Region endpoints. An operator who configures CRR discovers the gap during a DR runbook. Verify the workload's requirements against the limitations list BEFORE provisioning.
NEVER use
create-directory-bucketfor an S3 Tables table bucket. Why it's wrong: table buckets are created viaaws s3tables create-table-bucket, a separate API. Usingcreate-directory-bucketcreates a plain directory bucket with no table semantics. The Iceberg table operations will fail.
Output format
DIRECTORY_BUCKET_SPEC: <bucket-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓|✗] AZ ID resolved: <az-id> (from AZ name <az-name>)
[✓|✗] Directory bucket name format: base--az-id--x-s3 verified
[✓|✗] Directory bucket created: BucketType=Directory confirmed
[✓|✗] Encryption: SSE-S3 | SSE-KMS (<key-id>)
[✓|✗] Bucket policy: s3express ARN format, correct principal
[✓|✗] Zone-affinity compute: <n> instances in AZ <az-id>
[✓|✗] Table bucket (if applicable): created via s3tables API | N/A
[✓|✗] Unsupported features confirmed absent: CRR=no, versioning=no, Object Lock=no
VERIFICATION_COMMANDS:
<copy-pasteable verification commands>
STRICT output contract
The rules below are hard constraints. Violating any one produces a checklist that looks complete but contains a silent misconfiguration. Self-check EVERY emitted block against these rules before returning.
Required output structure
Every response MUST be a single block using these literal labels, in this order. Do NOT preface with prose, headings, or disclaimers.
DIRECTORY_BUCKET_SPEC: <bucket-name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓|✗] AZ ID resolved: <az-id> (from AZ name <az-name>)
[✓|✗] Directory bucket name format: base--az-id--x-s3 verified
[✓|✗] Directory bucket created: BucketType=Directory confirmed
[✓|✗] Encryption: SSE-S3 | SSE-KMS (<key-id>)
[✓|✗] Bucket policy: s3express ARN format, correct principal
[✓|✗] Zone-affinity compute: <n> instances in AZ <az-id>
[✓|✗] Table bucket (if applicable): created via s3tables API | N/A
[✓|✗] Unsupported features confirmed absent: CRR=no, versioning=no, Object Lock=no
VERIFICATION_COMMANDS:
<copy-pasteable verification commands — one per [✓] item>
FORBIDDEN output patterns
NEVER emit
VERDICT: READY_TO_DEPLOYwithout showing ALL 8 checklist items. Every item MUST appear with a status marker:[✓](applied and verified),[✗](not applied or misconfigured), or[N/A](not needed for this workload). Omitting a row implies it was not evaluated.NEVER mark the directory bucket name format as
[✓]without showing the full bucket name. The name encodes the AZ and the--x-s3suffix. A bare[✓]with no name implies the format was not validated. The full name MUST be cited.NEVER mark the directory bucket creation as
[✓]without confirmingBucketType: Directory. Operators who usecreate-bucketget a standard bucket. The verification MUST cite theBucketTypefield fromlist-buckets.NEVER mark zone-affinity compute as
[✓]without citing the specific AZ ID. A bare[✓]implies "same region" which is insufficient. The AZ ID of the compute MUST match the bucket's AZ ID.NEVER mark table bucket as
[✓]without confirming thes3tablesAPI was used. Usingcreate-directory-bucketfor a table bucket produces a plain directory bucket. The verification MUST cite thes3tablescommand.NEVER emit
VERDICT: PREREQUISITES_MISSINGwithout citing the specific gap. Each[✗]item MUST have a one-line reason:[✗] AZ ID not resolved — operator must provide AZ name or AZ ID. A bare[✗]with no explanation is non-compliant.
Perfect example output — READY_TO_DEPLOY
DIRECTORY_BUCKET_SPEC: my-app-data--use1-az1--x-s3
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] AZ ID resolved: use1-az1 (from AZ name us-east-1a)
[✓] Directory bucket name format: my-app-data--use1-az1--x-s3 verified (double-dash delimited, --x-s3 suffix)
[✓] Directory bucket created: BucketType=Directory confirmed via list-buckets
[✓] Encryption: SSE-KMS (arn:aws:kms:us-east-1:111111111111:key/abc-123)
[✓] Bucket policy: s3express ARN format (arn:aws:s3express:us-east-1:111111111111:my-app-data--use1-az1--x-s3)
[✓] Zone-affinity compute: 4 x c7n.large in AZ use1-az1 (subnet subnet-aaa)
[N/A] Table bucket: not applicable (object-level workload)
[✓] Unsupported features confirmed absent: CRR=no, versioning=no, Object Lock=no
VERIFICATION_COMMANDS:
aws ec2 describe-availability-zones --zone-names us-east-1a --query 'AvailabilityZones[0].[ZoneName,ZoneId]' --output text
aws s3api list-buckets --query 'Buckets[?Name==`my-app-data--use1-az1--x-s3`]' --output json
aws s3api get-bucket-encryption --bucket my-app-data--use1-az1--x-s3
aws s3api get-bucket-policy --bucket my-app-data--use1-az1--x-s3
aws ec2 describe-instances --filters "Name=tag:Name,Values=zone-affinity-app" --query 'Reservations[].Instances[].[InstanceId,Placement.AvailabilityZoneId]' --output table
Perfect example output — PREREQUISITES_MISSING
→ Secondary example moved to references/worked-examples.md; the READY_TO_DEPLOY example above is the primary contract.
Recent AWS features
→ Moved to references/advanced-patterns.md — S3 Tables integration, AZ ID targeting, zone-optimized compute.
References (load on demand)
- references/advanced-patterns.md — expert heuristics (zone mismatch, name parser, table API) and recent AWS features.
- references/worked-examples.md — secondary worked example (PREREQUISITES_MISSING).
- references/directory-bucket-config-patterns.md — pre-existing: configuration patterns.
- references/provisioning-cli-commands.md — pre-existing; extended with the 8-step provisioning summary.