#67 - Building MVP On AWS
A few minutes on accounts, encryption keys and networking can save a painful migration later.
18 min read
Join Andrey, Julien, and Mattias in this episode of DevSecOps Talks as they delve into building Minimum Viable Products (MVPs) and selecting the best solutions for them. Andrey goes first and, as an AWS consultant, kicks off the discussion by outlining his preferred AWS services for MVP development.
The AWS setup choices you can’t redo cheaply
You have an idea, a repository with something half working in it, and a deadline that exists mostly because you set it. The cloud part feels like a tax on getting to the first user. So you click through the signup, pick whatever compute looks closest to hand, and get back to the product. That is the right instinct for most of what you are about to do.
It is the wrong instinct for about four of those decisions. Some choices in a new AWS account are free to change next month: instance size, container memory, which region you added by accident. Others are a migration. You can’t encrypt an RDS database after you create it, and you can’t change its KMS key either. Two VPCs that carry the same address range can’t be peered, so the day they have to talk, you either renumber one side or pay for something that hides the overlap. And if the name and address on your signup form don’t match the card you paid with, the account can be blocked while AWS checks you out, which turns a shipping week into a support ticket.
Register the account like AWS will check it
Start before the first resource, with the form nobody reads twice.
What happens if your AWS account details don’t match your billing?
AWS can block the account while it checks for fraud, and you spend the week arguing with support instead of shipping.
We have watched this happen to a customer: variations of the name and address across the signup form and the payment details, and the account was blocked for roughly a week. Nothing about that is unreasonable: fresh accounts with inconsistent identity details are what fraud looks like from the outside. Put in a real name, a real address that matches your billing, and a phone number that reaches you.
The email address matters more than it looks. Account recovery runs through it, so use one you control and can send mail from, not an alias that only forwards.
Then turn on MFA for the root user. A hardware key if you own one, a TOTP app otherwise. AWS has been phasing this in rather than asking: management account root users came first, and from July 2024 the console MFA requirement reached root users of standalone accounts, rolled out gradually over several months. The same change added passkeys as an MFA option.
You still need root occasionally, so don’t destroy it. Just stop reaching for it.
Create the organization before you create anything
With the account open, the next choice costs two minutes and decides how much mess you can contain later.
Do you need AWS Organizations for an MVP?
If you would be sorry to throw this account away in three months, yes: create the organization first, then create separate accounts under it for development and production.
The original account becomes the management account and runs nothing. From there you create the member accounts, so a bad deploy, a leaked key or a runaway script is bounded by the account it happens in rather than by your whole footprint. That bound holds as far as you keep cross-account permissions narrow. A role in one account that trusts another is a door you built deliberately, and a stolen credential walks through it the same way your deploy does. If you are genuinely in a rush, create production only and work there. We went through the longer version of this argument, including where micro-segmentation stops paying for itself, in our episode on multi-account strategy and landing zones.
If this really is a throwaway you will scrap after the demo, skip all of it and build in the one account you just made. That is a real answer.
None of this needs tooling yet. You click it.
Fifteen minutes of GuardDuty, CloudTrail and billing alerts
The organization earns its keep mostly through what you can switch on across it.
What is the minimum security setup worth doing before you deploy anything?
GuardDuty enabled per Region from a delegated administrator, an organization CloudTrail trail, an EventBridge rule that mails you the findings, and a cost anomaly alert.
CloudTrail can log every account in the organization through a single organization trail, applied to all Regions, and the defaults are fine. GuardDuty does not work that way. It is a Regional service: you designate the delegated administrator and enable it one Region at a time, and in each Region you decide separately whether existing accounts are added and new ones come on automatically. Membership of the organization protects nothing by itself. Turn it on where you deploy, and keep in mind that whoever takes your credentials picks the Region, not you.
Findings don’t mail themselves either. GuardDuty publishes to EventBridge, so you need a rule matching source aws.guardduty and detail type GuardDuty Finding with an SNS topic as its target, a topic policy that lets events.amazonaws.com publish to it, and an email subscription somebody clicks to confirm. A topic with your address on it and nothing wired to it is silence that looks like safety. What you buy once it works is a shout when GuardDuty spots an account takeover or crypto mining on your EC2 instances, the events a two person team otherwise notices last.
Then the cost anomaly alert. AWS compares your spend against its own model of your usage and emails you when it jumps. Two gaps are worth knowing about on a new account: a monitor needs around ten days of history for a service before it detects anomalies on that service, and it runs on Cost Explorer data, which lags by up to 24 hours. It will not catch the mistake you make in week one, so create it on day one anyway: the clock starts when the data does. Expect some false positives early, and keep them.
All of it together is ten to fifteen minutes of clicking, once.
App Runner or Lightsail, and what each costs
With the account boring and quiet, you need something that runs your code.
What is the fastest way to get a container running on AWS?
App Runner: give it your code or your image, and it builds, deploys, puts a load balancer and a DNS name in front, and scales it down when requests stop.
There are two ways in. Point App Runner at a GitHub repository and it builds from source on a managed runtime, Python, Node.js, Java and Go among them. A Dockerfile in the repository is not what it reads. For your own image, the build and the push stay yours: App Runner deploys one you have already put in Amazon ECR, and picks up a new push only when you switch automatic deployment on.
It’s the closest thing AWS has to Heroku. Deploys aren’t fast, and the hostname is long and ugly: replacing it means associating your domain with the service and adding the certificate validation records it hands you. At the US East and Europe (Ireland) rates on the App Runner pricing page, active instances are $0.064 per vCPU-hour and $0.007 per GB-hour, so one vCPU with 2 GB running all month works out near $57.
The alternative is Lightsail, the DigitalOcean of AWS: its own simplified console, where instances, load balancers, databases and container services are a couple of clicks each. The headline $5 a month is a 512 MB Linux instance with a public IPv4 address; the smallest container service is $7. Run docker compose on a box and you are at five or ten dollars a month, with more to mind. Shell access differs: Session Manager replaces SSH on EC2, while a Lightsail instance registers as an on-premises node, where interactive access needs the charged advanced tier.
Those are compute prices alone, and the network bill is the easy one to guess wrong. A private database subnet needs no NAT gateway: traffic to an RDS endpoint in the same VPC never leaves it, and calls to AWS services can take a VPC endpoint. NAT is what you pay for when something in a private subnet calls the public internet, a payment provider or a package registry: $0.045 an hour and $0.045 per GB processed in US East, plus the $0.005 an hour every public IPv4 address has carried since February 2024 for the one it sits behind. Over a 730 hour month, about $36.50 before a byte of traffic moves.
A front end on top of either is S3 with CloudFront.
What we would skip at this stage
That leaves most of the AWS compute catalogue, and the reasons to pass on each are specific.
Should you build the MVP on Lambda?
Only if the shape of the work fits: a Lambda function is capped at 15 minutes, and if latency is part of your product promise, it is probably not where you start.
You can build the whole thing on Lambda. Whether that drags API Gateway in depends on what you are serving. Function URLs have given a function its own HTTPS endpoint since April 2022, which covers a webhook or a single-purpose service, and a whole web framework too: AWS’s own walkthrough of moving an Express application onto Lambda picks a Function URL because “one function URL forwards all routes to the Express server”. Ask for custom authorizers, request validation or usage plans and you are writing gateway configuration before you have a user. A container is more portable across the places you might run it next. Elastic Beanstalk we would skip, not because it is broken but because easier options now exist. ECS and EKS both work and both hand you more to configure, the opposite of what this stage needs.
Amplify is the honest gap in this list. We have not built on it, so take the omission as missing experience rather than a verdict. For a JavaScript developer building a JavaScript front end, that developer focused path may be the shortest road there is.
Startups rarely start with an infrastructure person, which is the real caveat on this whole list. These choices come from a tools-and-backend perspective, and someone who writes front end code all day would draw a different map. Treat this as one route through AWS rather than the definitive guide to building an MVP on it. The five minute decision at the beginning is still the one companies spend millions unpicking years later.
DynamoDB, RDS, and the key you pick before you create
With compute settled, the storage choice is the one that quietly sets your ceiling.
Is DynamoDB a sensible default for a new product?
Often, as long as you create the table in on-demand capacity mode: then you pay per request, you do no capacity planning, and there is no VPC to put it in.
The mode is a choice you make at creation, not a property of the service. Provisioned mode has you declare reads and writes per second, and bills you for what you declared rather than what you used, which is guesswork nobody can do well on a product with no traffic yet. On-demand was introduced in 2018 for that case, and it is the half of DynamoDB people mean when they call it serverless.
It is also NoSQL, which is a data model commitment and not only a billing one. DynamoDB does support transactions, with limits worth reading before you lean on them: up to 100 items and 4 MB in one transaction, within a single account and region. If you need real relationships, joins, and a schema you will be querying in ways you can’t predict yet, that argument is over and you want RDS: the cheapest Postgres instance in a single region, with Aurora left until the workload argues for it.
One setting inside that RDS instance does not get a second chance. AWS is explicit: “You can only encrypt an Amazon RDS DB instance when you create it, not after the DB instance is created." The same page adds the other half: once an encrypted instance exists, you can’t change the KMS key it uses. The way out is a snapshot, an encrypted copy of it, a restore from the copy, and a new endpoint for your application.
So spend one minute in KMS before you click create. Make a customer managed key, tick the box that makes it a multi-Region key, and encrypt the database with it. Related replicas share key material and key ID, so ciphertext from one region decrypts in another with no re-encryption step. Authorization stays per key: each replica has its own key policy and its own grants, and KMS synchronizes neither. A cross-region snapshot copy still needs a key in the destination region, plus permission to use the source key and that one. Most services that integrate with KMS treat a multi-Region key as single-Region, so check the service page rather than assume anything replicates by itself.
Delete the default VPC and draw a real one
The last piece of groundwork is the network, and it starts by removing something.
Why not just use the default VPC?
Because every default VPC in every account and region carries the same 172.31.0.0/16 range and only public subnets, and peering is not allowed between VPCs with matching or overlapping CIDR blocks.
Overlap closes peering, not connectivity in general. AWS wrote up the ways around it in 2022: PrivateLink to publish one service across the overlap, or a private NAT gateway to hide the subnets behind other addresses. Both work, and both add a service to run and pay for in place of a peering connection you could have had for free by picking a different range on day one. Renumbering the other side is the other option, and it is the one nobody wants in a quarter when the product is finally busy.
AWS’s guidance moved the same way: it used to be to strip every rule from the default security group, and the startup security baseline now says to delete unused VPCs, subnets and security groups outright, in every region rather than only where you deploy. If you need one back, aws ec2 create-default-vpc makes a new one.
Lightsail is the exception, and it is why “unused” matters. Lightsail resources sit outside your VPCs, and they reach anything inside one through Lightsail’s own peering, which attaches to the account’s default VPC: AWS says peering does not work without one. So where a Lightsail instance has to query a private RDS database, that region’s default VPC is load-bearing and stays. The App Runner setup below has no such tie, because it joins the VPC you drew.
Build that replacement from the console. Choose VPC and more and you get public and private subnets across availability zones, an internet gateway, NAT gateways and the route tables wired up in one step. One NAT gateway is plenty while you are the only user, at the $36.50 a month above. Put the load balancer in the public subnets and the application in the private ones. Give the database its own subnets with no route to the internet, and make them two subnets in two Availability Zones: a DB subnet group must contain at least one subnet in at least two AZs in the region, and RDS applies that to a Single-AZ instance too.
Connecting App Runner and your developers to the VPC
A private subnet keeps the database off the internet, which also means nothing reaches it until you decide what does.
What has to change once the database has no route to the internet?
Two things get access on purpose: the application through a VPC connector, and you through Session Manager or a VPN.
App Runner runs outside your VPC by default, which is also how it reaches the public internet. Attach a VPC connector and your application’s own outbound traffic moves into your subnets, which is what makes a private database endpoint reachable. Not everything moves with it: image pulls from ECR and log delivery to CloudWatch keep running over App Runner’s own network and need no path through yours. What your code calls on the internet does change, and now depends on your route tables: a default route from the private subnets to a NAT gateway in a public subnet, or a VPC endpoint for the AWS services it uses. Allow the connector’s security group on the database port, and keep database credentials in Secrets Manager rather than your image.
Then the developer, whose question is the one that actually puts databases in public subnets. Use Session Manager on a small EC2 instance in the private subnet, which gives shell access “without the need to open inbound ports, maintain bastion hosts, or manage SSH keys”, or run a VPN into the network. Both add friction, and pretending otherwise is why the shortcut keeps winning.
What this means for teams
Almost all of this is clicking. The account, the organization, GuardDuty, CloudTrail, the finding notifications and the billing alert come to ten or fifteen minutes between them; the application, the database, the network and developer access take as long as they take. The decisions that need thought are few: whether you will want a second account, whether your data is relational, which key encrypts the database if you have one, and what address range your network uses if you need one.
The cloud is still someone else’s computer, and you are unlikely to find its limits with the workload you have today. You will find the limits of your own time first, which is why the service that saves you a pipeline is usually worth more than the instance that saves you forty dollars.
This week, if you are standing up something new:
- Check the name, address, email and phone on your AWS account against your billing details, and fix any mismatch before you deploy.
- Create the organization and a production account, then enable GuardDuty per Region, an organization CloudTrail trail, findings to your inbox through EventBridge and SNS, and a cost anomaly alert.
- If your data model needs RDS, create a multi-Region customer managed KMS key before the instance and encrypt the database with it, since neither can be changed afterwards. On DynamoDB, choose on-demand capacity mode; there is no instance to encrypt at creation, and no VPC to put the table in.
- Delete the default VPC in every region, whatever database you chose, keeping it only where Lightsail runs, since its peering depends on it. Where you need a VPC of your own, build it from the console wizard, with private subnets and two database subnets in two Availability Zones. Pick an address range you would not mind peering one day. Decide how a developer reaches the database before one asks.
Common questions, answered
How do I stop a surprise AWS bill on a side project?
Create a cost anomaly alert the day you open the account, and don’t trust it for the first fortnight. AWS models your normal spend and emails you when it jumps, but a monitor needs around ten days of history for a service before it reports anomalies there, and its Cost Explorer data lags by up to 24 hours. Pair it with GuardDuty findings in your inbox, because the two watch different signals: the anomaly monitor sees the money, GuardDuty sees the activity behind it, such as crypto mining on a compromised instance. Neither stops the spend. They shorten how long it goes unnoticed.
Do I need Terraform or CDK to build an MVP on AWS?
No. Click through the console, get the product in front of users, and add infrastructure as code when the project survives long enough to justify it. An organization, two accounts, GuardDuty, CloudTrail and the alerts are a few minutes of console work, and writing them as code first mostly buys you a slower week. The exception is anything you can’t change later, like the KMS key on your database: no tooling makes it reversible.
How do I let App Runner reach a database in a private subnet?
Attach a VPC connector to the App Runner service, pointing at your private subnets, and allow the connector’s security group on the database port. App Runner runs outside your VPC by default, so a new service reaches public endpoints but not a private RDS one. The connector moves application-initiated outbound traffic into your VPC, while image pulls and log delivery keep running over App Runner’s own network. Anything your code calls on the public internet needs a default route from those subnets to a NAT gateway in a public subnet. Keep the credentials in Secrets Manager.
Related episodes
- #66 Multi-Account Strategy And Landing Zones: the longer argument about how many AWS accounts you actually need, with AWS consultant Fernando Gonçalves.
- #50 History of AWS networking and new ways to design your VPC setup: what VPC design options exist beyond the two-tier layout, and when they pay off.
- #11 AWS Security Maturity Roadmap: the account-level security baseline this setup is a fast version of.
Resources
- ACCT.09 Delete unused VPCs, subnets, and security groups: the instruction to delete default VPCs in every region, from AWS’s startup security baseline.
- Connecting networks with overlapping IP ranges: what you can still do when two VPCs share a CIDR, and what each option costs you in moving parts.
- Deep dive on AWS App Runner VPC networking: which traffic a VPC connector moves into your subnets, and which keeps running over App Runner’s own network.
- Amazon Lightsail instances FAQ: confirms Lightsail VPC peering needs the account’s default VPC.
- Encrypting Amazon RDS resources: confirms encryption and the KMS key are creation-time only, and gives the snapshot workaround.
- Control access to multi-Region keys: settles what replicas share and what they don’t, policies and grants included.
- Processing GuardDuty findings with Amazon EventBridge: the rule, target and topic permissions that turn findings into email.
- The longer video walkthrough from FivexL: the same setup demonstrated step by step in the console.
Since we recorded
AWS App Runner, the recommendation this article leans hardest on, stopped accepting new customers on April 30, 2026 and is now in maintenance mode, with existing services still running and new workloads pointed at Amazon ECS Express Mode. The DynamoDB-first advice got cheaper almost immediately, since AWS cut on-demand throughput prices by 50% and global table prices by up to 67% from November 1, 2024. Root credential handling changed too: AWS launched centralized root access management for Organizations in November 2024 and extended the MFA requirement to member account root users, so the password manager is no longer the only option there. We returned to the underlying managed-versus-self-run question in #90 K8s vs Managed Services: Cost, Lock-In, and Reality.
