How to Create an Access key and secret key to access the S3 Bucket?
Last updated
Last updated
Sign in to your Amazon Web Services (AWS) account:
Under Services, choose 'All services' and open the 'IAM' (Identity and Access Management) console.
Under 'Access management', click Users and then 'Create user'.
Specify the IAM user name (read the other instructions properly and grant permissions as desired).
Click 'Next'.
The next step involves granting permissions to the user-specified.
One can add this new user to the existing groups by selecting 'Add user to group' or to copy the policies from an existing user, select 'Copy permissions' options.
OR
You can create a custom policy with the necessary permissions to restrict access to a single Amazon S3 bucket when creating an IAM policy for an IAM user using JSON. Select 'Attach policies directly' and click 'Create policy'.
Select 'JSON" from the displayed options.
This displays the 'Policy editor window' where you can define the policy.
Below is an example of a JSON policy that allows read access to a single S3 bucket named "my-example-bucket" (you can modify it to fit your specific requirements).
Sign in to the AWS Management Console.
Navigate to the IAM service.
Create or select the IAM user to restrict access to.
In the "Permissions" tab for the user, click "Add permissions."
Choose "Attach existing policies directly."
Click the "JSON" tab and paste the JSON policy into the text box.
Review and click "Next: Review" to proceed.
Review the permissions and the policy you attached to the user.
Click "Add permissions" to attach the policy to the user.
You can modify the JSON policy to include additional actions or restrict access according to your requirements.
Once you have defined the permissions accordingly, click 'Next'.
Review the details specified and click 'Create user'.
Once the user is created successfully, identify and click on the name to proceed.
Click Security credentials, and under Access Keys, click 'Create access key'.
This takes you to a screen which prompts you to consider use cases and alternatives.
Click 'Other' (read the best practices for managing the access key).
Click 'Next'.
Specify the description tag value and click 'Create access key'.
This generates your Access and Secure Access keys.
Once the access key and the secret access keys are generated, copy and paste them to a secure location, as you can view the Secret access key only once.
Click 'Done' to complete the process.