What’s your strategy regarding managing AWS accounts? Do you manage a single account, or account per env/customer/something else?
Obviously it depends on the use-cases. My use-case is is a single org and the product is multi-tenant (meaning we don’t have a stack per client) and across regions.
What would be drawbacks from having multiple accounts? What are some challenges? The main advantage of managing everything in a single account is ease of operation.
Would love to hear your experience with single / multi accounts, and your rational behind the decisions you did.
Splitting accounts are definitely useful. Our accounts are:
AWS Management account. No resources here, just for the org. Might add some SCPs here eventually, but we haven’t gotten there yet.
AWS SSO Account. More controlled access, and root credentials and MFA shared by some key team members in case we ever get locked out of SSO
Product main account, prod. EKS and RDS and Route53. The original account from when we started.
Staging product
Monitoring. Grafana/prometheus stack hosted here. No staging version, but we’ve considered it.
Website resources in S3 buckets (separate account primarily because we use external website contractors)
IaC account, where Terraform state lives and other config management stuff runs from.
“data science” account, with some Athena and S3 type data processing
This setup limits blast radius (eg: terraform runs with a role only in the needed account), keeps things easy to find, billing split up appropriately. Makes it easy to alert on suspicious activity (like logging into management or SSO account without a good reason).
If there’s one change I’d make: Use a per-region account for our product, as we often roll out features region-by-region to limit blast radius. (Our product is run to allow any one region to fail, and runs from 4 regions)
Logs and backups should be fed into a dedicated security account. Even if you keep prod in one account, at least have another account with just S3 buckets where you push logs and backups so that no matter what level of access someone gains to your prod account, you still have those things in the security account.
Multiple accounts with AWS control tower on top of AWS organization will give you a start with best practices out of the box. Including AWS Identity Center.
Dedicated account is the preferred way. At least for org/log/audit and application.
The benefit of dedicated accounts is the full isolation. Of course, for security reasons, billing but also with dedicated quotas for each account.
Challenges is sharing resources or data between accounts. It takes more effort to restore the production database into the pre-prod-account, or share a VPN/direct connect to your on premise cross accounts.
Other point is the cost factor. For example, with full isolation with account per team/dev and your stack needs ALB, nat Gateway, RDS etc you will spend a lot of money to it.
It’s a trade off between security/isolation and cost/effort. It depends on your workload, organization, requirements, size and and and
benefit of multiple account is that you have sandbox/development account that will have 0 effect on the mistakes that you or others can make.
also there are a lot of cloud software that requires different access level to do something on your AWS account, (e.g. security software). Having a different account gives you the ability to play before deploy to prod, or limit coverage to a certain account.
At the same time, this can backfire if the connection/install is per account…
With IaC like terraform, or cloudformation, there is no need to perform most of manual deployment these days, so that’s a easy task.
Frankly, it was annoying and scary, but mostly worked out fine. Most of the reason our product main account is only a single account is because it’s hard to move data (s3 buckets, RDS instances, etc) to another account.
I work at a B2B SaaS..
We have a multi account strategy, over 100 accounts that we moved to about 4 years ago. (from a simple prod, test, dev 3 account setup)
This is not per tenant though, that would be way too expensive..
Instead we follow an account “per application domain, per region”
SO we broadly break up our (large complex) application into bounded contexts and deploy each bounded context into a separate account we call a “domain account set”. We created some functionality on the back of AWS landing Zone to “vend” out new domain accounts sets.
So each “domain” gets 5 regional production accounts pre configure with out of the box security controls (1 for each region we operate in), plus a staging account for pre prod testing. They are also connected to a regional transit gateway and routed to the internet through their regional “egress” region account which proxies / filters all outbound traffic from the vpcs.
We also have a shared development account plus a few other shared management and service accounts including
Security (centralising across all account security data)
Logging (centralised logging)
IAM (for initial sign on before switching roles into other account)
Master (org account)
This is a scalable setup allowing for excellent operational security. (it means a breach in one part of you applicant doesn’t automatically mean your whole application is at risk) .
I was under the impression that you weren’t able to change which account was the root account in an organization. But it seems like you have been able to do that.
Also, is your terraform IaC account where all IaC runs? As in, is your production account configured from the IaC account? And if so, how do you find the complexity of managing cross-account permissions?
(2nd reply, because I didn’t have time between meetings to answer the TF question).
Yes, our Terraform runs in single IaC account. State/locks are stored in S3/dynamo there. Each of our TF stack assumes a role in the target account. That’s worked well, and makes things like using remote state from another project easy.
For example, all the other accounts need vpc peering with Grafana, so we have a single terraform setup for peering which can touch all the accounts to set that up. It uses all the remote state from the vpc setup which is per-account to figure out what CIDRs to map.