AWS Certified Cloud Practitioner / Identity and Access Management

AWS Access Keys, CLI and SDK

🌐 Accessing AWS: Console, CLI, and SDK

So far we've used the AWS Management Console — the web interface. But there are actually three ways to access AWS.


1. AWS Management Console

The web interface in your browser. Protected by username, password, and (ideally) MFA. Every button click is really just AWS calling its own APIs behind the scenes — the Console is a graphical wrapper around the same API calls.


2. AWS CLI (Command Line Interface)

A tool you install locally and run from your terminal instead of clicking around.

aws s3 ls

Type a command → CLI sends it to AWS → AWS authenticates and processes it → result prints in your terminal.

Authentication: Access Keys — an Access Key ID (like a username) and a Secret Access Key (like a password).

Never share these, never treat them casually, and give each user their own.

The CLI can fully replace the Console, works great in scripts and automation, and is open-source. Some people use nothing else.


3. AWS SDK (Software Development Kit)

Built for use inside your application code, not a terminal. Your app calls AWS APIs directly — a web app uploading to S3, a server launching EC2 instances, a mobile app writing to DynamoDB.

It's language-specific (Python/Boto3, JavaScript, Java, Go, Ruby, PHP, .NET, Node.js, plus mobile and IoT variants), embedded in your code, and authenticates with the same Access Keys as the CLI. In fact, the CLI itself is built on the Python SDK — so SDK = the underlying library, CLI = a tool built from it.


A real example: uploading a profile picture

Say you're building a React + Node app and want uploaded profile pictures stored in S3 instead of on your own server. Your Node backend uses the AWS SDK to send the file straight to S3:

import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import fs from "fs";

const s3 = new S3Client({
  region: "ap-south-1",
  credentials: {
    accessKeyId: "YOUR_ACCESS_KEY",
    secretAccessKey: "YOUR_SECRET_KEY",
  },
});

async function uploadFile() {
  const fileStream = fs.createReadStream("profile.png");
  const command = new PutObjectCommand({
    Bucket: "my-app-bucket",
    Key: "users/user123/profile.png",
    Body: fileStream,
    ContentType: "image/png",
  });
  await s3.send(command);
}

Flow: user uploads from the frontend → backend receives it → SDK sends it to S3 → S3 stores it → you save the file's URL in your database. This is the standard pattern behind profile pictures, product images, invoices, and media uploads everywhere.

⚠️ Never put AWS credentials in frontend code. Upload through your backend, or use pre-signed URLs.

Bottom line: the SDK is the bridge between your code and AWS. Without it, you'd be crafting raw API calls by hand — with it, it's just a few lines like above.