10 AWS Tricks That Make You Say: Wait, AWS Can Do That?
10 surprisingly useful AWS capabilities I found through workshops, community discussions, and AWS Heroes and Community Builders, with practical examples and use cases.
Series: AWS Builder Rabbit Holes (1 article)
- 110 AWS Tricks That Make You Say: Wait, AWS Can Do That? This article
The more I learn AWS, the more I realize that some of the most useful things aren't new services at all.
They're small features hidden inside services that I thought I already understood.
A request header.
A CloudFormation property.
An SSM document.
A managed integration.
A feature in S3 that completely changes how you can think about metadata.
Those are the things that make me stop and think:
Wait, AWS can do that?
I started collecting these after finding them in completely different places.
I'm a moderator of r/AWSCertifications and r/IndianDevs, so I regularly come across discussions where people are troubleshooting AWS problems, sharing solutions, or mentioning little tricks that don't always show up in the usual tutorials.
I've also picked up quite a few things while attending AWS workshops. One thing I really enjoy about workshops is when the speaker goes beyond the planned material and says something like, “Here's something we actually use,” or “Here's a little thing that's easy to miss.”
Those small comments sometimes end up being the most useful part of the session.
Another huge source has been AWS Community Builders and AWS Heroes. Their articles are a goldmine for this kind of thing because they often explain the problem behind a solution, what they tried, and why a particular AWS feature ended up being useful.
So I started following those rabbit holes.
Then I went back and checked the relevant AWS documentation.
I deliberately left out the usual “use CloudShell,” “use Terraform,” or “create a CLI alias” type of tips. Those can absolutely be useful, but I wanted to find the things that make you think:
“I have been using AWS for years and didn't know this existed.”
I'm keeping this as a series because I found way too many interesting ones to fit into one article.
This is Part 1.
And yes, the topics are intentionally random.
No S3-only section. No networking-only section.
Just 10 AWS rabbit holes.
1. You Can Use an S3 Conditional Write as a Simple Distributed Lock
Let's start with one of the strangest ones.
The problem
Imagine you have several workers processing jobs.
You want exactly one worker to claim a particular job.
Something like this:
┌── Worker A │Job 123 ─────────┼── Worker B │ └── Worker CAll three workers see:
“Job 123 needs to be processed.”
But only one of them should actually do it.
Otherwise you could end up processing the same payment twice, generating the same report multiple times, sending duplicate notifications, or running an expensive operation unnecessarily.
A common solution is to use DynamoDB as a lock or coordination table.
You might have:
job-123status = LOCKEDowner = worker-Aand use DynamoDB conditional writes to make sure only one worker gets the lock.
That's a perfectly reasonable architecture.
But stop and think about what you've just added.
You now have another database, another resource, another IAM configuration, another thing to monitor, and another part of your infrastructure to maintain.
And sometimes all you really wanted was:
“Can one worker claim this before everyone else?”
The trick
S3 supports conditional writes.
You can make a
PutObject request with:If-None-Match: "*"That tells S3:
Only create this object if it doesn't already exist.
Now imagine all your workers try to create:
locks/job-123The first successful write creates the object.
Another worker tries to create the same key.
S3 rejects the write because the object already exists, returning a
412 Precondition Failed response.So you effectively get:
Worker A ──┐Worker B ──┼──> PUT locks/job-123Worker C ──┘
↓
first successful write ↓ winner
competing writes ↓ 412A simple example
A worker could make a request like:
aws s3api put-object \ --bucket my-lock-bucket \ --key locks/job-123 \ --body /dev/null \ --if-none-match "*"If it succeeds:
“I got the claim.”
If it fails because the object already exists:
“Someone else got there first.”
That's it.
Your S3 object is now acting as a tiny coordination record.
Why this is clever
S3 is usually introduced as:
Object storage.
You probably think about it as:
uploaddownloaddeleteBut the conditional write capability gives you another primitive:
Create this only if nobody else has created it.
That sounds simple.
But that primitive can be surprisingly useful.
A practical example
Imagine an image-processing system:
S3 upload ↓EventBridge ↓multiple workersSeveral workers might receive the same event or otherwise discover the same object.
Before processing:
PUT locks/images/photo-123If-None-Match: "*"One worker succeeds.
The others know they lost the race and can stop.
You now have a basic claim or deduplication mechanism without immediately adding a separate lock table.
When this makes sense
This can be useful for:
- simple job claiming
- deduplication
- one-time initialization
- basic idempotency
- simple leader selection
- “only one worker should do this” workflows
When I would not use it
This is not a replacement for every distributed locking system.
If you need sophisticated lease management, fencing tokens, complex ownership rules, transactional state, or automatic lock expiration, you need a design intended for those requirements.
The interesting part is knowing when you don't need all of that.
The lesson
Before adding another AWS service just to get one primitive, ask:
“Does a service I'm already using have the primitive I need?”
Sometimes it does.
And sometimes that means an entire component disappears from your architecture.
2. S3 Can Carry Its Own Context With S3 Annotations
This is probably my favorite recent discovery in the list.
The problem
S3 is great at storing files.
But modern applications increasingly need to store information about those files.
Imagine a bucket containing millions of documents.
The object might be:
documents/contracts/contract-1842.pdfBut your application also wants:
classification = confidentiallanguage = Englishdepartment = legalprocessing_status = completerisk = mediumsummary = ...A traditional approach is to create another data store:
┌── S3 │Application ───┤ │ └── metadata databaseAt first, that looks perfectly normal.
Until your objects start moving around.
Suddenly metadata becomes a synchronization problem
Suppose your S3 object is:
old/path/report.pdfand your metadata database contains:
old/path/report.pdfclassification = confidentialNow the object gets copied or moved.
You need to make sure the metadata follows it.
Then you start dealing with:
- copies
- deletes
- retries
- renames
- partial failures
- metadata getting out of sync
- objects modified outside your application
Your simple metadata feature has turned into a synchronization system.
The trick
S3 Annotations give you a way to attach mutable, structured metadata to S3 objects.
Instead of thinking:
file → database record about fileyou can start thinking:
file+its contextFor example:
summaryclassificationprocessing statuslineagecompliance informationAI-generated contextapplication metadataAnd this is where it gets really interesting
The annotations can be part of the S3 Metadata ecosystem and exposed through managed metadata tables using Apache Iceberg.
That opens the door to querying metadata using tools such as Athena.
Conceptually:
S3 Object │ Annotations │ ▼ S3 Metadata │ ▼ Iceberg tables │ ▼ Athena │ ▼ SQLImagine an AI document pipeline
Suppose you process five million PDFs.
Your AI pipeline analyzes every document and produces:
{ "summary": "Agreement between company A and company B", "classification": "confidential", "risk": "medium", "language": "en"}You could create another database to hold all of that.
Or you can consider attaching that context directly to the S3 objects.
Now the object carries useful information about itself.
And your metadata can become something you query at scale.
You can ask questions like:
“Find all confidential documents.”
Or:
“Show me everything that hasn't finished processing.”
Or:
“Find all high-risk files.”
Why this changes how I think about S3
The important idea here is metadata locality.
The thing describing the object is associated with the object.
That can reduce the amount of custom synchronization and reconciliation logic you'd otherwise have to build.
The mental model changes from:
data+another database containing information about the datato:
data+context about the dataThis isn't just for documents
You could imagine this for:
- ML datasets
- media files
- scientific data
- compliance data
- application artifacts
- AI-generated outputs
- data lineage
- processing pipelines
Anything where you repeatedly need to attach context to objects is worth considering.
Important caveat
This does not mean:
“Databases are no longer needed.”
They obviously are.
There are plenty of workloads that need transactions, high-frequency mutable state, relational queries, specialized indexes, or data that is independent of a particular object.
The point is simply that S3 now gives you another architectural option.
Why this one made the list
Most of us learned:
S3 = filesDynamoDB = application dataAthena = analyticsNewer S3 capabilities blur those boundaries a little.
And those are exactly the kinds of AWS discoveries I like.
AWS announcement:
https://aws.amazon.com/blogs/aws/amazon-s3-annotations-attach-rich-queryable-context-directly-to-your-objects/
3. EC2 Has an Emergency Door for When SSH Is Broken
The problem
Your EC2 instance is alive.
Your application might even be running.
But:
SSH doesn't work.
You start checking:
Security Group?Route table?NACL?Network interface?SSH service?Firewall?Maybe you accidentally changed something.
Maybe your firewall configuration is wrong.
Maybe the OS networking is broken.
And that's where things get frustrating.
You need the network to fix the network.
The trick
EC2 Serial Console.
For supported instances and operating systems, AWS provides another way to access the instance through its virtual serial port.
So you have something like:
Normal access:
Laptop ↓Network ↓SSH ↓EC2and another path:
Emergency access:
Laptop ↓AWS ↓Serial Console ↓EC2Example
Imagine you accidentally block SSH.
Security GroupPort 22 ↓blockedYou try:
ssh ec2-user@...Nothing.
If your instance and environment support EC2 Serial Console, you have another management path that doesn't depend on normal SSH connectivity.
That can allow you to fix things such as:
- firewall rules
- SSH configuration
- networking
- boot problems
- OS configuration
Why I think this is underrated
Most people mentally model EC2 as:
“A virtual machine I connect to over a network.”
Serial Console adds another possibility:
“A virtual machine with an alternate management path.”
You may not use it often.
But the day you accidentally lock yourself out of an important instance, knowing it exists can save a lot of pain.
4. Your CloudWatch Metrics Can Come Through Your Logs
The problem
Suppose your application needs custom metrics:
RequestsProcessedPaymentFailuresProcessingTimeCacheHitsOrdersCreatedOne straightforward approach is to explicitly call the CloudWatch API.
Conceptually:
Application ↓AWS SDK ↓CloudWatch API ↓MetricThat works.
But now your application has metric-specific code throughout it.
The trick
CloudWatch Embedded Metric Format, or EMF.
With EMF, your application can emit specially formatted metric information as part of its logs.
The conceptual flow becomes:
Application ↓structured logs ↓CloudWatch ↓metric extraction ↓CloudWatch MetricsYour application is already producing logs.
CloudWatch is already receiving them.
So you're using an existing pipeline to carry metric information too.
Example
Imagine a payments service generating structured telemetry:
service = paymentsstatus = successprocessing_time = 312The EMF structure can tell CloudWatch which values should become metrics.
Instead of your application separately calling the metric API for every measurement, the information travels through the log stream.
Why this is clever
The mental model normally looks like:
logs → CloudWatchmetrics → CloudWatch APIWith EMF, you can think more like:
structured telemetry ↓ CloudWatch ↙ ↘ Logs MetricsYou're reusing something you already have.
Why this can simplify applications
If you have many services producing lots of custom metrics, reducing the amount of AWS-specific metric publishing logic in application code can make instrumentation easier to manage.
This is especially useful when structured logging is already part of your application architecture.
Important nuance
This doesn't mean:
“Never use PutMetricData.”
There are situations where direct metric publishing is appropriate.
The useful lesson is:
Logs can sometimes be more than logs.
They can become an input to your metrics pipeline too.
AWS documentation:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format.html
5. EventBridge Pipes Can Remove Your Glue Lambda
The problem
You've probably seen:
SQS ↓Lambda ↓another AWS serviceSometimes the Lambda is doing important work.
But sometimes it literally does:
receive message ↓forward messageThat's it.
Yet you now have:
- Lambda code
- an IAM role
- deployment
- runtime configuration
- logs
- monitoring
- retry behavior
- maintenance
all for connecting two services.
The trick
EventBridge Pipes.
Pipes can connect supported event sources directly to supported targets, with filtering and enrichment capabilities where applicable.
So instead of:
SQS ↓Lambda ↓Step Functionsyou may be able to use:
SQS ↓EventBridge Pipe ↓Step FunctionsExample
Suppose an order enters SQS.
Your current flow is:
Order ↓SQS ↓Lambda ↓unwrap message ↓forward message ↓Step FunctionsIf the Lambda isn't doing real business logic, it's just plumbing.
Now the architecture can potentially become:
Order ↓SQS ↓Pipe ↓Step FunctionsOne fewer compute component.
Why removing one Lambda matters
It isn't just about deleting one function.
You can also remove:
source codeIAM roledeploymentruntimelogsmonitoringmaintenanceThe architecture gets smaller.
And smaller architectures are usually easier to reason about.
The question I like asking
Whenever I'm about to create a Lambda:
“Am I adding compute because I need computation, or because I need plumbing?”
If it's plumbing, check the native integrations first.
When Lambda is still the right answer
Use Lambda when you need:
- custom business logic
- complicated transformations
- validation
- external API calls
- custom processing
- integrations AWS doesn't provide natively
The lesson isn't “Lambda is bad.”
It's:
Don't write code for something the platform can already do.
6. Step Functions Can Sometimes Eliminate a Lambda Too
The problem
Here's another pattern:
Task A ↓Lambda ↓Task BYou inspect the Lambda.
And discover that it doesn't actually do anything particularly interesting.
It just transforms JSON.
For example:
{ "firstName": "Jane", "lastName": "Doe"}becomes:
{ "fullName": "Jane Doe"}That Lambda exists purely because one task produces data in a shape that the next task doesn't expect.
The trick
Step Functions supports JSONata for data transformation.
That means the workflow can potentially become:
Task A ↓JSONata transformation ↓Task Binstead of:
Task A ↓Lambda ↓Task BExample
Imagine Task A returns:
{ "customer": { "first": "Jane", "last": "Doe" }, "amount": 4999, "currency": "INR"}and Task B wants:
{ "customerName": "Jane Doe", "amount": 4999}If the only reason you're invoking Lambda is to reshape that payload, you may be able to keep the transformation inside the state machine.
Why this matters
That little Lambda may require:
- source code
- deployment
- IAM permissions
- logging
- monitoring
- retries
- runtime configuration
Removing it means removing all of that.
Think about a bigger workflow
You might have:
Receive event ↓Validate ↓Call service A ↓reshape JSON ↓Call service B ↓reshape JSON again ↓Call service CSome of those transformations can potentially remain inside Step Functions.
Then the workflow becomes:
Receive event ↓Validate ↓Call A ↓Transform ↓Call B ↓Transform ↓Call CThe workflow remains the workflow.
You don't keep jumping out to another compute service just to manipulate data.
The bigger lesson
The interesting part isn't just JSONata.
It's the broader pattern:
Every native capability added to an orchestration service is one less reason to create a helper Lambda.
Before creating a tiny Lambda, check what the service you're already using can do.
7. SSM Can Get You to a Private Database Without a Traditional Bastion
The problem
Your RDS database is private.
Good.
You don't want:
Internet ↓RDSBut you're a developer and need temporary access to troubleshoot something.
The traditional approach is often:
Developer ↓Bastion host ↓Private RDSNow you have an EC2 instance whose main purpose is to act as a tunnel.
That means:
- SSH
- keys
- patching
- hardening
- security groups
- monitoring
- lifecycle management
The trick
Systems Manager has an SSM document named:
AWS-StartPortForwardingSessionToRemoteHostThis can let a managed EC2 instance act as an intermediary for port forwarding to another private host.
Conceptually:
Developer laptop ↓localhost:5432 ↓SSM Session Manager ↓managed EC2 ↓private RDSExample
Suppose your private PostgreSQL database is:
database.internaland listens on:
5432Instead of exposing the database to the public internet, you can establish the SSM port-forwarding session and point your local database client at:
localhost:5432From your laptop's perspective, you're connecting locally.
Behind the scenes, the session is carrying the connection through the managed instance to the private database.
Why this is interesting
Most people know:
“SSM lets me connect to EC2.”
The more interesting capability is:
“SSM can provide a path through that instance to another private host.”
That makes SSM useful for more than simply opening a shell.
When this is useful
This can be particularly useful for:
- development
- troubleshooting
- database administration
- temporary private-network access
- internal debugging
Important caveat
The managed instance still needs appropriate network access to the destination, and your SSM agent, IAM permissions, and network setup need to be configured correctly.
It's not a magic tunnel through a disconnected network.
But for the right use case, it can remove a traditional bastion workflow.
AWS documentation:
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html
8. RetainExceptOnCreate Can Save You From a CloudFormation Headache
This one is tiny.
That's exactly why I like it.
The problem
Suppose you're using CloudFormation or CDK.
You have a stateful resource:
S3 bucketDynamoDB tableEFS filesystemYou don't want that resource deleted when you intentionally delete the stack.
So you use:
DeletionPolicy: RetainMakes sense.
Now imagine the initial stack creation fails.
Maybe something completely unrelated breaks halfway through deployment.
CloudFormation starts rolling the stack back.
Your retained resource can survive.
You fix the original problem.
Then you run:
cdk deployagain.
And now you run into something like:
Resource already existsYou end up manually cleaning up the remains of the failed deployment.
The trick
CloudFormation provides:
DeletionPolicy: RetainExceptOnCreateThe idea is to distinguish between two situations.
You intentionally delete the stack
Delete stack ↓keep resourceYour initial stack creation fails
Create stack ↓failure ↓rollback ↓newly created resource can be cleaned upWhy this makes sense
Those scenarios sound similar until you think about what you actually want.
If I intentionally delete my infrastructure:
I may want the data to survive.
If my initial deployment failed halfway through:
I usually don't want a half-created resource sitting around and blocking the next attempt.
This property lets CloudFormation treat those situations differently.
Why this is one of my favorite types of AWS trick
It's literally one property.
You don't need:
- a Lambda
- a cleanup script
- a scheduled job
- an EventBridge rule
- another service
Sometimes the best AWS trick is buried inside a service you thought you already understood.
AWS documentation:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
9. Validate IAM Policies Before You Discover the Problem at Runtime
The problem
IAM debugging has a very predictable cycle.
You write a policy.
It looks correct.
You deploy it.
Everything seems fine.
Then your application runs.
And:
AccessDeniedSo you change the policy.
Deploy again.
Try again.
Another error.
Change it again.
A tiny IAM change can turn into a surprisingly long debugging session.
The trick
AWS IAM Access Analyzer provides policy validation.
You can validate a policy before deployment.
For example:
aws accessanalyzer validate-policy \ --policy-document file://policy.json \ --policy-type IDENTITY_POLICYNow the development flow becomes:
Write policy ↓Validate ↓Deployinstead of:
Write policy ↓Deploy ↓Run ↓AccessDenied ↓Debug ↓Deploy againWhy this matters
This is the same basic principle we use everywhere else in software engineering:
Catch problems as early as possible.
A compiler catches certain code problems before runtime.
Tests catch certain bugs before production.
Static analysis catches certain problems before deployment.
Policy validation can move part of your IAM feedback loop earlier too.
Take it one step further
Put it into CI.
For example:
Pull Request ↓IAM validation ↓valid? / \no yes↓ ↓fail continue ↓ deploymentNow bad policies can be stopped before they make it into your infrastructure.
Why I like this one
It isn't flashy.
Nobody is going to see
validate-policy and think:“This is the coolest AWS feature ever.”
But after debugging IAM for the tenth time, it starts looking pretty good.
AWS documentation:
https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html
10. Don't Route S3 Traffic Through NAT Just Because It's Convenient
The problem
Imagine you've got an application running in a private subnet.
It needs to access S3.
One possible architecture is:
Private subnet ↓NAT Gateway ↓S3It works.
But now you're using a NAT Gateway as part of the S3 access path.
At small scale, you might barely notice.
Now multiply that architecture across:
multiple accountsmultiple VPCsmultiple environmentslarge S3 trafficSmall networking decisions start becoming recurring costs.
The trick
Use an S3 Gateway VPC Endpoint for appropriate S3 traffic.
The architecture can instead look like:
Private subnet ↓S3 Gateway Endpoint ↓S3Why this is nice
You don't need to rewrite your application.
Your code still does:
GetObjectPutObjectListObjectsThe optimization happens underneath it.
You're changing the path rather than the application.
Why scale matters
Imagine one development VPC.
Maybe the difference doesn't matter much.
Now imagine:
10 AWS accounts5 VPCs eachmultiple environmentslarge S3 workloadsThe same small inefficiency is now repeated dozens of times.
That's why networking choices are worth checking during cost optimization.
The question I like asking
Whenever a private workload communicates with an AWS service, ask:
“Am I using a generic network path when AWS already provides a service-specific one?”
Sometimes the answer is yes.
And sometimes the fix is much simpler than expected.
What These Random Hacks Have in Common
At first glance, these ten tricks are completely unrelated.
We went from:
S3 ↓distributed coordinationto:
S3 ↓metadatathen:
EC2 ↓emergency recoverythen:
CloudWatch ↓metricsthen:
EventBridge ↓managed integrationthen:
Step Functions ↓data transformationthen:
SSM ↓private accessthen:
CloudFormation ↓resource lifecyclethen:
IAM ↓policy validationand finally:
VPC ↓S3 networkingBut after collecting these, I noticed a pattern.
The best AWS discoveries often aren't about learning another service.
They're about realizing that a service you already have can do more than you thought.
S3 can be:
object storage+coordination primitive+metadata layerCloudWatch can be:
logs+metrics pipelineEventBridge can be:
event routing+managed integrationStep Functions can be:
workflow engine+data transformationSSM can be:
remote management+private access pathCloudFormation can be:
infrastructure definition+resource lifecycle controlThat's the part I find most interesting.
The Builder Question I Keep Coming Back To
When you're stuck on an AWS problem, it's very easy to immediately ask:
“Which AWS service should I add?”
I've started asking a slightly different question:
“What capability already exists that I can reuse?”
Need coordination?
Maybe you don't need another database.
Need to connect two services?
Maybe you don't need Lambda.
Need to transform JSON?
Maybe you don't need another helper function.
Need access to a private database?
Maybe you don't need a traditional bastion.
Need metadata for S3 objects?
Maybe you don't need another metadata store.
Need safer resource cleanup?
Maybe CloudFormation already has the lifecycle behavior you need.
Need to catch IAM problems?
Maybe you can catch them before deployment.
Need private S3 access?
Maybe NAT doesn't need to be in that path.
This mindset can lead to something even more valuable than memorizing AWS services:
Smaller architectures.
Fewer services.
Less code.
Fewer permissions.
Fewer deployment steps.
Fewer things to monitor.
Fewer things to break.
Where I Found These Rabbit Holes
A lot of these ideas came from other builders.
As a moderator of r/AWSCertifications and r/IndianDevs, I regularly see people discussing AWS problems, troubleshooting issues, and sharing solutions that don't always appear in the standard learning material.
I've also picked up a number of these tricks while attending AWS workshops.
One of my favorite parts of workshops is when the speaker goes beyond the planned material and shares something from their own experience.
Sometimes it's a tiny configuration detail.
Sometimes it's a shortcut.
Sometimes it's a completely different way of approaching a problem.
Those are often the parts I remember.
I've also spent a lot of time reading AWS Community Builder and AWS Hero articles.
I particularly like those because they often explain the reasoning behind a solution.
Instead of:
“Here's what this feature does.”
they explain:
“Here's the problem we had, here's what we tried, and here's why this AWS capability ended up being useful.”
That's where a lot of these rabbit holes started.
I then went back through the AWS documentation for the capabilities included here.
That last part matters.
There are plenty of “secret AWS hacks” online that turn out to be outdated, undocumented, unsupported, or based on assumptions that no longer apply.
I'd rather find a relatively obscure feature that AWS actually supports than rely on some clever trick that could disappear tomorrow.
Final Thought
AWS is so large that I don't think anyone ever reaches the point where they can honestly say:
“I know everything AWS can do.”
And honestly, I think that's part of the fun.
You learn a service.
You think you understand it.
Then someone shows you one obscure feature and suddenly you realize:
“Wait... AWS can actually do that?”
That's what I'm looking for in this series.
Not secret APIs.
Not random trivia.
Not another list of obvious AWS tips.
Just those small capabilities that can change how you build.
So the next time you're about to add another Lambda, database, bastion, cleanup script, or networking component, pause for a second and ask:
“Does AWS already have a primitive that can do this?”
You might save yourself some code.
You might save some money.
You might save a few hours of debugging.
And every once in a while, you might even be able to delete an entire box from your architecture.
Part 1 of AWS Builder Rabbit Holes.
More rabbit holes to come.
Series: AWS Builder Rabbit Holes (1 article)
- 110 AWS Tricks That Make You Say: Wait, AWS Can Do That? This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article