Pre-requisite
Before you install and utilize the AWS Serverless Application Model Command Line Interface (AWS SAM CLI), ensure you've met the necessary prerequisites.
For effective use of the AWS SAM CLI, you must have:
An AWS account, along with AWS Identity and Access Management (IAM) credentials and an associated IAM access key pair.
The AWS Command Line Interface (AWS CLI) installed, which is essential for setting up AWS credentials.
Overview
For this tutorial we are going to do the following:
- Sign up for an AWS account
- Create an IAM user account
- Create an access key ID and secret access key
- Install the AWS CLI
- Use the AWS CLI to configure AWS credentials
- Install AWS SAM
Step 1. Sign up for an AWS Account
https://portal.aws.amazon.com/billing/signup.
If you have not done so. Just follow the online instructions.
Step 2. Create an IAM user account:
- Log in to your AWS Account.
- Type IAM on the search bar and click
- From the IAM Dashboard, on the left hand side of your screen go to Access Management > User
- On the top right of your screen click "Create User".
- Fill in the username. For this example I will create "SamIAM".
- Click "Next"
- Under Permissions Options, select "Attach policies directly"
- Under Permissions policies, select "AdmistratorAccess"
- Scroll to the bottom and click "Next".
- For the next page, Review and create, just click "Create User"
Step 3. Create an access key ID and secret access key
- You will be prompted back to the main dashboard. Just select the user you just created, "SamIAM".
- Click on "Security Credentials" tab
- Scroll down and click "Create access key"
- Under "Use case" select "Command Line Interface (CLI)
- Select the confirmation in the bottom, "I understand the above recommendation and want to proceed to create an access key."
- Click "Next".
- Ignore this page, just click "Create access key".
- Copy the Access key and Secret access key to a notepad. You will need this when setting up your AWS CLI.
- For security, click "Download .csv file" and save that file in your personal drive.
Step 4. Install AWS CLI
- Click here and follow the instructions: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Step 5. Use the AWS CLI to configure AWS credentials
To configure credentials with the AWS CLI:
Run the
aws configure
command from the command line.Configure the following. Select each link to learn more:
The following example shows sample values.
$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-east-1
Default output format [None]: json
- Finally, install AWS SAM
Just follow the instructions in this link:
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
Top comments (0)