How to Setup AWS Credentials using Visual Studio Code


If you have not setup your AWS Credentials using the AWS CLI and want to set it up using Visual Studio Code, the first thing to make sure is you have AWS Toolkit for VS Code installed,

Tutotial: Installing AWS Toolkit for VS Code


Steps to Setup AWS Credentials using VS Code

AWS- Create Credentials Profile using VS Code
  1. Open VS Code Palette using Keyboard Shortcut: Command + Shift + P if on Mac (Control + Shift + P for Windows)
  2. Now type in: AWS Create Credentials Profile
  3. Now you will be guided with the steps as questions,

    Example:
    • Choose a unique name for the new profile (Press 'Enter' to confirm or 'Escape' to cancel): training
    • Input the AWS Access Key: AKXXXXXXJRWIAXXXXXU
    • Input the AWS Secret Key: kiiOXXXXXAeXoQa1RDZ3XXXXXXXXXXXZRttXXX
    • Show the default region "us-east-1" for credentials "profile:training" in AWS Explorer?: Yes
  4. Once these steps are complete, you should see two files opened on VS Code,

    Credentials
    [training]
    # This key identifies your AWS account.
    aws_access_key_id = AKXXXXXXJRWIAXXXXXU
    # Treat this secret key like a password. Never share it or store it in source
    # control. If your secret key is ever disclosed, immediately use IAM to delete
    # the key pair and create a new one.
    aws_secret_access_key = kiiOXXXXXAeXoQa1RDZ3XXXXXXXXXXXZRttXXX

    Config
    [default]
    region = us-east-1
    output = json
  5. You are all good to go! You will find the credentials and config file under your User directory inside .aws


Have Questions? Post them here!
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.