Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 8Name in the course: Cloud CLIs

Work with the three big clouds

Azure, AWS and Google Cloud have the same building blocks with other names: networks, VMs, managed Kubernetes, storage, identity. Each has a CLI for scripts and quick checks. Terraform makes the resources; the CLI is for login, kubeconfig, reading and emergencies.

  • 6 Lessons
  • 4 Commands

$ run as a normal user# run as root (or with sudo)

Skills in this chapter

  • Cloud CLIs — 4

8.1

Azure CLI

az manages Azure: resource groups, VMs, AKS, Key Vault, role assignments.

az login
az account set --subscription "Prod"
az aks get-credentials -g rg-shop -n aks-shop
az vm list -d -o table

Commands in this lesson

8.2

AWS CLI

aws manages AWS: EC2, S3, IAM, EKS, CloudWatch — with profiles per account.

aws sso login --profile prod
aws sts get-caller-identity --profile prod
aws eks update-kubeconfig --name shop --region eu-west-1
aws s3 cp backup.tar.gz s3://acme-backups/

Commands in this lesson

8.3

gcloud

gcloud manages Google Cloud: projects, VMs, GKE, Cloud Run, IAM.

gcloud config set project acme-shop-prod
gcloud container clusters get-credentials shop-gke --region europe-west4
gcloud run deploy shop --image europe-west4-docker.pkg.dev/acme/apps/shop:1.4.0 --region europe-west4

8.4

eksctl

eksctl makes EKS clusters with node groups and IAM roles for pods from one YAML file.

eksctl create cluster -f cluster.yaml
eksctl upgrade cluster --name shop --version 1.32 --approve
eksctl create iamserviceaccount --cluster shop --namespace shop --name s3-reader --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess --approve

8.5

Know the same service in three clouds

One table for the names you meet in job ads.

Building blockAzureAWSGoogle Cloud
NetworkVNetVPCVPC
VMVirtual MachineEC2Compute Engine
Managed KubernetesAKSEKSGKE
Containers without serversContainer AppsECS / FargateCloud Run
Object storageBlob StorageS3Cloud Storage
SecretsKey VaultSecrets ManagerSecret Manager
Identity for workloadsManaged IdentityIAM rolesService accounts
MonitoringAzure MonitorCloudWatchCloud Monitoring
IaC nativeBicep / ARMCloudFormationDeployment Manager

8.6

Log in from CI without stored keys

GitHub Actions and GitLab can get short-lived cloud tokens with OIDC — no secret keys in the pipeline.

  1. Azure: a federated credential on an app registration; azure/login with client-id, tenant-id, subscription-id.
  2. AWS: an IAM role that trusts token.actions.githubusercontent.com; aws-actions/configure-aws-credentials.
  3. Google Cloud: Workload Identity Federation; google-github-actions/auth.

Remember

Check the active account before every delete: az account show, aws sts get-caller-identity, gcloud config list.

All commands in this chapter