DEV Community

ADITYA OKKE SUGIARSO
ADITYA OKKE SUGIARSO

Posted on

Creating IAM Access Keys for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY

stack:

  • aws
  • go

ref:

intro:

IAM user access keys consist of two parts:

  • Access key ID (for example: AKIAIOSFODNN7EXAMPLE)
  • Secret access key (for example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY)

You must use both the access key ID and the secret access key together to authenticate requests made through the AWS SDK.

step:

1. Create IAM user

  • Open the IAM Dashboard in the AWS Management Console. In the left navigation pane, choose Users.

users menu on IAM dashboard

  • click Create user button

Create user button

  • set user name

specify user details

  • on set permissions, create group to attach the policies

set permissions

  • Set a group name and choose permission policies. These policies usually provide full access per AWS service. If you need more fine-grained control, you can create your own custom policies by selecting the Create policy button.

create user group

  • after that, review and select Create User button

review and create

2. Create access key

  • choose Create access key
    create access key

  • choose local code

access key local code

  • fill any meaningful name then choose create key

description tag

  • if sucess, you will have AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to put on .env

access key created

  • now you can put both key on .env. AWS SDK will automatically detect the key on .env
AWS_ACCESS_KEY_ID=AKIAZF************
AWS_SECRET_ACCESS_KEY=utiKWhMNy***********************************
Enter fullscreen mode Exit fullscreen mode

Top comments (0)