sst.dev icon indicating copy to clipboard operation
sst.dev copied to clipboard

Comments: Create an IAM User

Open jayair opened this issue 9 years ago • 3 comments

Link to chapter - http://serverless-stack.com/chapters/create-an-iam-user.html

jayair avatar Apr 10 '17 00:04 jayair

I wonder if there is a way to reduce the security exposure this creates. I am going to do the cli development and testing on a small ec2 instance (which can be stopped and started to keep costs down), and assign a role to it rather than using credentials. This also bypasses the need to install the aws cli, and hopefully won't present any issues installing required software!

SherpaPsy avatar Apr 20 '17 08:04 SherpaPsy

@SherpaPsy That is a great security practice! It is a bit out of the scope of this tutorial, but it is definitely the preferred approach.

For those who are interested, this is around limiting the use of IAM users in favor of IAM roles. The problem with IAM users is that the credentials (Access key ID and Secret access key) that are assigned and used in AWS CLI are not automatically cycled. By leveraging IAM roles, you can assign temporary short lived credentials to a specific AWS resource, in this case an EC2 instance. When an EC2 instance is launched, you can assign an IAM role, so that when functions or commands run within that instance, they will be executed using the credentials of the IAM role. In this case, IAM services will automatically cycle the credentials that are allocated to the EC2 instance at regular interval.

Actually, our Lambda functions are assigned with IAM roles in the exact same fashion behind the scene with policies allowing it to access DynamoDB.

fwang avatar Apr 20 '17 20:04 fwang

This issue was moved to https://discourse.serverless-stack.com/t/comments-create-an-iam-user/92

jayair avatar May 09 '18 18:05 jayair