PoshJosh's Blog

Notes on Amazon Web Services 8 - Command Line Interface (CLI)

March 02, 2020

Command Line Interface (CLI)

  • AWS API provides for communication with AWS throw HTTP/s calls

  • AWS API documentation available for many services

  • Utiilized by:

    • AWS Management Console
    • AWS Command Line Interface (CLI)
    • AWS Software Development Kits (SDKs)
    • Other AWS services.
  • API calls can only be made by valid security credentials:

    • Console access - Account username and password
    • CLI - IAM user access key ID and secret. IAM user downloads access key ID and secret to be able to issue CLI commands.
    • SDKs - IAM temporary credentials. Your app may use google, facebook etc to authenticate external users e.g via Oauth2. Temporary Oauth2 credentails are thus issued by google, facebook etc. With such credentials you could have limited and temporary access to AWS cloud.
  • API calls can be logged cusing CloudTrail service.

AWS CLI Application

  • AWS CLI application is available for Windows, Mac, Linux. It allows API Commands to be sent to AWS using command line for Windows, terminal for Linux?Mac.

  • AWS Shell cross platform standalone integrated shell environment written in Python.

  • AWS Tools for Windows PowerShell

AWS Cloud9 IDE

  • An Integrated Development Environment (IDE) running on EC2 accessed throw the AWS Management Console.

  • AWS CLI application pre-installed

  • Increased security as IAM credentials are not saved on computer.

  • When used in conjuction with multi-factor authentication (MFA), account cannot be access with username and password only.

AWS CLI Usage

  • Management Console -> Services -> Cloud9 -> Create Environment

  • Add at least a name

  • Select: Create a new instance

    • Select the type of instance
    • Select the platform
    • Select cost saving
  • The enviroment is created in a VPC

  • Settings -> Preferences -> Themes

Sample CLI commands via Cloud9 IDE

  • Check if AWS CLI is installed:
$aws --version
  • Create an s3 bucket named mybucket
$aws s3 mb s3://mybucket
  • Copy a document named Notes.pdf to an s3 bucket named mybucket

Note: First upload the document named Notes.pdf to the Cloud9 directory

$aws s3 cp Notes.pdf s3://mybucket
  • Delete the document named Notes.pdf from the s3 bucket named mybucket
$aws s3 rm s3://mybucket/Notes.pdf

Notes

  • Using AWS Cloud9 IDE service for sending CLI commands provides increased security because you don’t have to download credentials, thus reducing exposure. You may ask, what about the username and password used to connect to managment console… well you could enable multi-factor authentication on those.

  • Select cost saving when creating a Cloud9 environment EC2 instance. This saves cost by going into hibernation when the EC2 instance is not being used.

  • To view cli reference, browse to: aws.amazon.com/cli -> click CLI Reference

  • S3 api vs S3 commands - S3 api commands are far more in number, the commands are more verbose and powerful.

  • To delete a Cloud9 environment, Click on Cloud9 -> Select your environment -> Click delete.

Acronyms

  • CLI - Command Line Interface
  • SDK - Software Development Kits
  • IDE - Integrated Development Environment
  • MFA - Multi-factor Authentication

Links

References


Written byChinomso IkwuagwuExcélsior

Limited conversations with distributed systems.

Modifying legacy applications using domain driven design (DDD)

Gherkin Best Practices

Code Review Best Practices

Hacking Cypress in 9 minutes

Some common mistakes when developing java web applications

How to make a Spring Boot application production ready

SQL JOINS - A Refresher

Add Elasticsearch to Spring Boot Application

Add entities/tables to an existing Jhipster based project

CSS 3 Media Queries - All over again

Maven Dependency Convergence - quick reference

Amazon SNS Quick Reference

AWS API Gateway Quick Reference

Amazon SQS Quick Reference

AWS API Gateway Quick Reference

AWS Lambda Quick Reference

Amazon DynamoDB - Quick Reference

Amazon Aurora

Amazon Relational Database Service

AWS Database Services

AWS Security Essentials

Amazon Virtual Private Cloud Connectivity Options

Summary of AWS Services

AWS Certified Solutions Architect - Quick Reference

AWS CloudFront FAQs - Curated

AWS VPC FAQs - Curated

AWS EC2 FAQs - Curated

AWS Achritect 5 - Architecting for Cost Optimization

AWS Achritect 4 - Architecting for Performance Efficiency

AWS Achritect - 6 - Passing the Certification Exam

AWS Achitect 3 - Architecting for Operational Excellence

AWS Achitect 2 - Architecting for Security

AWS Achitect 1 - Architecting for Reliability

Amazon DynamoDB Accelerator (DAX)

Questions and Answers - AWS Certified Cloud Architect Associate

Questions and Answers - AWS Certified Cloud Architect Associate

AWS Connectivity - PrivateLink, VPC-Peering, Transit-gateway and Direct-connect

AWS - VPC peering vs PrivateLink

Designing Low Latency Systems

AWS EFS vs FSx

AWS Regions, Availability Zones and Local Zones

AWS VPC Endpoints and VPC Endpoint Services (AWS Private Link)

AWS - IP Addresses

AWS Elastic Network Interfaces

AWS Titbits

Jenkins on AWS - Automation

Jenkins on AWS - Setup

Jenkins on AWS - Best practices

Introduction to CIDR Blocks

AWS Lamda - Limitations and Use Cases

AWS Certified Solutions Architect Associate - Part 10 - Services and design scenarios

AWS Certified Solutions Architect Associate - Part 9 - Databases

AWS Certified Solutions Architect Associate - Part - 8 Application deployment

AWS Certified Solutions Architect Associate - Part 7 - Autoscaling and virtual network services

AWS Certified Solutions Architect Associate - Part 6 - Identity and access management

AWS Certified Solutions Architect Associate - Part 5 - Compute services design

AWS Certified Solutions Architect Associate - Part 4 - Virtual Private Cloud

AWS Certified Solutions Architect Associate - Part 3 - Storage services

AWS Certified Solutions Architect Associate - Part 2 - Introduction to Security

AWS Certified Solutions Architect Associate - Part 1 - Key services relating to the Exam

AWS Certifications - Part 1 - Certified solutions architect associate

AWS Virtual Private Cloud (VPC) Examples

Curated info on AWS Virtual Private Cloud (VPC)

Notes on Amazon Web Services 8 - Command Line Interface (CLI)

Notes on Amazon Web Services 7 - Elastic Beanstalk

Notes on Amazon Web Services 6 - Developer, Media, Migration, Productivity, IoT and Gaming

Notes on Amazon Web Services 5 - Security, Identity and Compliance

Notes on Amazon Web Services 4 - Analytics and Machine Learning

Notes on Amazon Web Services 3 - Managment Tools, App Integration and Customer Engagement

Notes on Amazon Web Services 2 - Storages databases compute and content delivery

Notes on Amazon Web Services 1 - Introduction

AWS Auto Scaling - All you need to know

AWS Load Balancers - How they work and differences between them

AWS EC2 Instance Types - Curated

Amazon Web Services - Identity and Access Management Primer

Amazon Web Services - Create IAM User

Preparing Jenkins after Installation

Jenkins titbits, and then some

Docker Titbits

How to Add Chat Functionality to a Maven Java Web App

Packer - an introduction

Terraform - an introduction

Versioning REST Resources with Spring Data REST

Installing and running Jenkins in Docker

Automate deployment of Jenkins to AWS - Part 2 - Full automation - Single EC2 instance

Automate deployment of Jenkins to AWS - Part 1 - Semi automation - Single EC2 instance

Introduction to Jenkins

Software Engineers Reference - Dictionary, Encyclopedia or Wiki - For Software Engineers