Help!!! My auditor had a comment in our AWS audit “Separate EC2 clusters (currently they are in the same availability zones)” is this referring to spreading the production cluster in different availability zones or having separate zones for production vs staging?
Means using multiple azs for production
You can and will lose an AZ at some point. Running everything in one AZ will cause an outage eventually.
If you’re running autoscaling groups, you can fairly easily migrate the ASG to use multiple AZs. You SHOULD do that. While AZs are pretty solid for reliability, they are not perfect, and if that AZ goes down you’re dead in the water. Spread your workloads out across AZs and make sure that no one workload (for prod) lives only in one AZ.
Regarding separating staging vs production… different accounts please. If Prod and Staging are in the same account you are one bad script away from blowing away everything. Plus you’ll start hitting API limits and it’s harder to accurately know what costs are from Prod and what’s from Staging.
Last year there was an AWS outage for a specific AZ and since the company I audited didn’t diversify their environment, they took a bit hit and lost a lot of money for it.
How does VPC look like? (Subnets, etc.)
great tips
Is referring to spreading the production cluster in different availability zones.
Distribute your compute per stack across as many az’s as you can. This means that app A’s component, let’s say stack X (backend compute nodes), should be distributed as evenly as possible in AZ 1, 2, and 3 assuming there are 3 AZs. (aka round robin distribution)
This is NOT saying that app A’s stack X should be in AZ 1, stack Y in AZ 2, stack Z in AZ 3.
Hope that helps.
Yes
Think of availability zones as totally seperate data centers in the same city but different location, seperate power and managment. Something will happen to one from time to time, but it is unlikely to happen to both.
People should start using billing tags regardless of account separation as well!
They absolutely should, yes. But if you are only gonna do one thing for your cost insight… separating by account gets you -something- and it gives you the most OTHER benefits to go along with it.
Arn’t using different IAM user for each stage like one for staging and one for prod enough to be fault tolerant. Because multiple accounts for each environment could be a hassle to manage, also conneection parameters will be a lot complex.
-
if you’re still using IAM users and not roles, you’re already losing. SSO and federated roles or GTFO. Seriously. My clients treat the -existence- of IAM users to be a security event and anything that DOES exist (service accounts) has a documented ticket number attached to it that is periodically audited, and the keys get auto-rotated.
-
No, IAM differences are not enough because inevitably SOMEONE is going to be given an Admin or equivalent role that can breach that separation. Additionally if you are using IAM users then it’s quite likely you’re using static access keys and secret keys, which means you’re one “oopsies” away from a malicious actor gaining persistent access to your environment. If that bad actor happens to get keys that have IAM permissions then they can just make a role that had access to both staging and prod.
-
multiple accounts are not hard to manage if you know how to do so. Since you’re claiming it to be hard, you obviously don’t know how. Connection parameters can be stored in SSM Parameter Store and fetch them by assuming roles if need be, or write a very simple api gateway & lambda front end to fetch them from a centralized account.
-
better than needing to synchronize parameters across account, however, is understanding why you even need to. Deployments should be going staging then production and they should be the -exact- same code and -exact- same deployment to both. Therefore you deploy to staging with the updated parameters, test it, and then do the exact same deployment to production, and that deployment handles updating or creating parameters. Production and staging should be getting out of sync (parameters wise) because they should be stored separately because you don’t want someone who is testing something for staging accidentally break prod because prod was referencing the same parameter and wasn’t expecting the change. The trick is making sure that production and staging get back into sync -when they are supposed to-.
-
Same account same region means you are still bound to the same API limits and activities in staging can result in throttling to production.
-
Additionally there are some service limits per account that can’t be raised (IAM roles and S3 buckets come to mind).
-
additionally it’s harder to manage RIs/SPs, and ODCRs within the same account because App A can start to use stuff meant for App B.
-
Limits raised for App A can be used by App B before App A can use them, which means you need to re-open a ticket and get it re-raised. It’s not super painful but it is annoying.
-
if you are a government customer or your business is structured in such a way that you have different colors of money, like if App A and App B are funded separately and they can NEVER be allowed to spend or benefit from eachother’s money, then you MUST go multi-account. You cannot guarantee clean separation of funds within a single account.
Do you want me to keep going?
Thanks for the feedback, so roles instead of IAM huh. For now connection parameters are stored in a CM tool. Hence cross-account access gets complex. So you’re saying there should be 3 roles for 3 environments. I’ll have to look into how it works technically. So attach different roles to services or IAM users ??
Who downvoted me lol? It was a genuine question. IAM user strategy is right at the starting of SA course.
And yes for 4) deployment is same and they differ only by parameters.
Did something change recently?
https://www.lastweekinaws.com/blog/aws-cross-az-data-transfer-costs-more-than-aws-says/
Yes
You’re right, there are charges for some data transfer between Availability Zones in the same Region. Load Balanced data transfer is free, as well as to services like S3 and Dynamo. But yes, there is a cost between instances and RDS.
That seems like a pretty massive thing to me. Database chatter can be enormous