MultiCloud Classroom notes 18/mar/2026

Azure cli

Login AZURE CLI

az login

create resource group

az group create --name demo-vm --location EastUS

create VM using azure CLI

az vm create \
    --resource-group demo-vm \
    --name ubuntu-vm \
    --image Canonical:0001-com-ubuntu-server-focal:20_04-lts:20.04.202505200 \
    --admin-username azureuser \
    --assign-identity \
    --generate-ssh-keys \
    --public-ip-sku Standard \
    --size Standard_D2s_v3

create Bastion on same region watch class recording

AWS Setup and EC2 Operations Guide

Step 1: Configure AWS CLI

Before running any commands, configure AWS CLI with your credentials:

aws configure
  • AWS Access Key ID: IAM user’s access key

  • AWS Secret Access Key: IAM user’s secret key

  • Default region name: Example: us-east-1

  • Default output format: Example: json

Step 2: Create IAM User and Grant Admin Permissions

  • Create a new IAM user and attach the AdministratorAccess policy:
  • attach-user-policy: Grants full admin rights
aws iam create-user --user-name demo-admin
aws iam attach-user-policy --user-name demo-admin --policy-arn arn:aws:iam::aws:policy/AdministratorAccess

Step 3: Create a Security Group

  • Defines a new security group in the specified VPC
aws ec2 create-security-group --group-name demo-sg \
    --description "service-vm" \
    --vpc-id vpc-063acb2d29664ae86

Step 4: Authorize SSH Access

  • Adds inbound rule for SSH (port 22) from all IPs
aws ec2 authorize-security-group-ingress --group-id sg-05d9e5feb84460622 \
    --protocol tcp --port 22 --cidr 0.0.0.0/0

Step 5: Launch an EC2 Instance

  • Starts a new EC2 instance with the specified AMI, type, key, SG, and subnet
aws ec2 run-instances --image-id ami-0ec10929233384c7f \
    --count 1 \
    --instance-type t3.micro \
    --key-name local \
    --security-group-ids sg-05d9e5feb84460622 \
    --subnet-id subnet-0544cf9a2c7effd59

Step 6: Describe Security Groups

  • Shows details of the security group
aws ec2 describe-security-groups --group-ids sg-05d9e5feb84460622

Step 7: Manage EC2 Instances

  • Stop an Instance
aws ec2 stop-instances --instance-ids i-02ba90a1b05a23019
  • Start an Instance
aws ec2 start-instances --instance-ids i-02ba90a1b05a23019
  • Describe Instances by Tag Lists EC2 instances filtered by tag env=dev
aws ec2 describe-instances --filters "Name=tag:env,Values=dev"

Step 8: Cleanup Resources

  • Terminate Instance
aws ec2 terminate-instances --instance-ids i-02ba90a1b05a23019
  • Delete Security Group
aws ec2 delete-security-group --group-id sg-05d9e5feb84460622

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%