Managing AWS User Credentials in Jenkins

How to store AWS Access Key and Secret Access Key in Jenkins.

There are multiple ways you can save AWS “Access Key ID” and “Secret Access Key” in Jenkins.  I have given two ways you can save these credentials and invoke them while running Jenkins jobs.

Way1: Using Secret Text

Step1: On Jenkins Dashboard go to “Manage Jenkins”, after that go to “Manage Credentials”. Now click on the “global” section under Domain shown below. Now click on “global” section under Domain shown as below. 


Step2: Click on “Add Credentials”. 


Step3: Now under the “Kind” drop down box select “Secret text”, keep the scope as global, and copy-paste the Access Key ID which you got from AWS IAM Console while creating User. Fill up the ID and Description field and click “OK”

Step4: Follow a similar step to save “Secret Access Key” and click “OK”.



Way2: Using Amazon EC2 Plugin

For this you need Amazon EC2 Plugin installed on your Jenkins machine. Follow Step1 and Step2 same as above.

Step3: Now under the “Kind” drop down box select “AWS Credentials”, keep the scope as global, and copy-paste “Access Key ID” and “Secret Access Key”  which you got from AWS IAM Console while creating User. Fill up the ID and Description field and click “OK”.


Finally, you have saved AWS credentials using two ways to access it through Jenkins Jobs. 


No comments:

Post a Comment