Terraform Configuration for AWS

To manage the resources in AWS through terraform, you should have ACCESS_KEY and SECRET_ACCESS_KEY.

Follow below steps to get the credentials.

Goto IAM

IAM

Click on “Users” and click on “Add user”

Add_User.PNG
Provide username and Select Access type as “Programmatic access”

Terraform_User

Click on “Next: Tags” and Click on “Next: Review”

Review the permissions and Click on “Create user”

User_Details.PNG
Download the CSV file and keep it safe and secure. It contains Access key ID and Secret access key.

Download

Creds

Finally, click on “Close”.

If you lose the credentials accidentally, Follow the below steps to create new credentials.

Goto Users and Click on the username.

Edit_User

In the next page, Click on “Security credentials”. 

Security_Creds

Here you can found Access key details.

Click on create “Create access key” to create a new access key and download the CSV file or copy the credentials.

New_Key

Make sure to inactive the unused or old access key.

Click on Make inactive or delete the key.

inactive.PNG

You are not allowed to have more than keys. So delete unused keys.

Note: Both Access Key Id and Secret access key will change every time when you create a new Access key.

 

If you have aws cli installed in your machine, you can also execute “aws configure” command to add credentials.

$ aws configure
AWS Access Key ID : XXXXXXXXXXXXXXXXXXX
AWS Secret Access Key : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Default region name [us-east-1]: 
Default output format [json]:

 

Advertisements

Learn Technology

%d bloggers like this: