Create IAM role
Generate IAM user and access key
- Go to IAM service administration interface
- Click Create role
- In the **Choose a use case ** section, we click on EC2 to create an IAM role to use for the application running inside EC2.
- In the Filter policies box, enter S3.
- Click AmazonS3FullAccess, we will grant full access to access and upload files to the S3 bucket we created.
- Click Next: Tags.
-
Click Next: Review.
-
Set Role name to ec2roles3upload
Next, we will use this role to assign to the EC2 instance and make it possible for our application to upload files to S3 without using the access key and secret access key in the code.