How should individual developers access DEV/PROD accounts in an AWS Organization?

Hi,

For some small hobby projects, I use AWS Organization to manage the different stages of applications. An application will have a DEVELOPMENT account and a PRODUCTION account for the respective stages. Each application is in its own OU (containing both stages).

Now, I usually login via the Administrator role (IAM of root user) and then assume either DEVELOPMENT or PRODUCTION. I’m pretty sure this isn’t best practice.

In addition, I now want to give a friend of mine access to the DEVELOPMENT/PRODUCTION account of a certain project. This is where this approach is clearly not working anymore. Therefore I wanted to ask, what is the recommended way of setting up and giving access to developer accounts?

I looked at the various guides from AWS, such as What is AWS Organizations? - AWS Organizations and Establishing your best practice AWS environment - Amazon Web Services, but I couldn’t find this info!


Related discussions:

I am sure that there are other ways to do this, I believe that using AWS SSO is one way, but I haven’t used it, I started reading the documentation and it seemed like a solution for a big org as it didn’t seem like a simple way to set up access.

In the org I work for, we use a 3rd party authentication provider to allow users to log in to an account.

To do this a user will log in to this provider (that would be okta or opal.dev in our case), if they want console access they can select the role/account they want and they are then provided with access through their web session (but it will only work for an hour). CLI access is also handled fairly nicely, opal provide a cli tool for this and okta have one, but it is being phased out now (which is why we now use opal),. These basically just update your `.aws/config` or credentials file so that when you try to use awscli/terraform/whatever it finds the creds in your env

When the user logs in, they are given access to a role in the management account, this role has the ability to assume the other roles in the other accounts, and no other permissions. This means they don’t have access to the root management account, instead they can basically do nothing in the management account, until they assume another role. To make switching roles easier in the browser we use the role switcher plugin

Actually in the case of opal, it’s actually a user in the management account, but assuming roles is the same, I believe using a role instead is on the way

We use SSO and Azure AD.
Then we provision permission sets which become roles on accounts and assign users or groups to the account-permission set combo.

We have a very restricted permission set for prod. Set up so the devs can only view the “surface” of things and only read logs and a dlq-messages and such. No data-access. Only read access on the little they can see.

Changes need to happen through the pipeline.

Data need to be kept from being readable.

Dev accounts are a free-for-all. :wink:

Thanks for all the answers. After doing some more googling, and your input, I have found that I could setup AWS Control Tower, which will automatically setup some blueprints I could use, as well as AWS IAM Identity Center (successor to AWS SSO). I would move existing users and OUs into the new Control Tower setup. Then I can setup access for the devs in AWS IAM Identity Center.

Is this a good path to take?

For me, I like to keep things simple as long as possible before I move to all the other tools like Control Tower, etc.

For the past of least resistance and to follow what I believe to be best practices, I would do the following for your friend and for you:

  1. Create IAM users for the both of you, with Console access.
  2. Create a Role for Admin (you) and another for Friend (your friend). Assign policies to it according.
  3. Then, both of you login and change your role as needed.

Not much more is required to achieve what you’re looking for, imo.

AWS Identity Center.. Formally known as AWS SSO. Yes this is the way. SSO is integrated with the CLI now.

yes

Yes to SSO (aka IAM Identity Center) but no to Control Tower.

Control tower is probably overkill for a hobby organization.

And never, ever use the root user - delete any keys associated with it, and make sure you have MFA enabled.

This is the way.

It’s reasonable, and certainly the way to go when you have tens or hundreds of devs to support.

The biggest drawback is that you have to sign-in to a login session for each AWS account. So it’s a bit of a hassle to MFA in for each account (and I typically run something like Firefox multi-account container for each account).

Having a plain IAM User in a central account and creating Roles that you can switch to in the sub-accounts means you can MFA once and use AWS Extend Switch Roles to bounce between accounts. It’s much faster for bouncing between accounts. If you want to scale that style to tens of users, a tool like Paco lets you declare what kind of Roles you can assume and who is allowed to assume each one, then it takes care of setting up those Roles for you. IAM Role trust policies have something like a 2048 char limit, so it doesn’t scale beyond around 30 users or so though …

it didn’t seem like a simple way to set up access

  • Enable SSO
  • Add user
  • Grant user permission to account

It’s sooo much simpler than IAM users that need to assume roles cross account