How to create an IAM user with Programmatic access with Full Access to S3 using the PHP SDK

Viewed 145

I am trying to create a new IAM user (programmatic access only) that has full access to Amazon S3 using PHP SDK.

I looked at https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-iam-2010-05-08.html#createuser and I am not able to figure out what parameter is required to indicate programmatic access only to the user. Does specifying the username alone indicates it to be Programmatic user? Once I create the user, I am assuming, I have to call the "createAccessKey" method for that user to get the access credentials? Is that right?

1 Answers

You are correct. createuser only creates an IAM user without any permissions. By default the user can't do anything, including no programmatic access. To enable the access you have to call createAccessKey.

Since the user has no permissions by default, you will also need to add IAM policy to the user with S3 permissions.

Related