Showing posts with label AWS Cloud. Show all posts
Showing posts with label AWS Cloud. Show all posts

Tuesday, November 11, 2025

AWS DMS for Data Migration and more

 🧠 DBA Tip: AWS DMS Isn’t Just for Migrations — It’s a Hidden Gem for Continuous Replication

If you’ve ever had to move a live production database with near-zero downtime, AWS Database Migration Service (DMS) can save your weekend.

Here’s a quick example setup I recently used to replicate an on-prem Oracle DB to Amazon Aurora PostgreSQL — while keeping both in sync until cutover 👇


⚙️ Step 1: Create a Replication Instance

aws dms create-replication-instance \ --replication-instance-identifier dms-repl-prod \ --replication-instance-class dms.r6i.large \ --allocated-storage 100 \ --multi-az

⚙️ Step 2: Define Source and Target Endpoints

aws dms create-endpoint \ --endpoint-identifier oracle-src \ --endpoint-type source \ --engine-name oracle \ --username admin \ --password '****' \ --server-name oradb01.example.com \ --port 1521 \ --database-name PRODDB aws dms create-endpoint \ --endpoint-identifier aurora-target \ --endpoint-type target \ --engine-name aurora-postgresql \ --username dbauser \ --password '****' \ --server-name aurora-cluster.cluster-xyz.us-east-1.rds.amazonaws.com \ --port 5432 \ --database-name prod_migrated

⚙️ Step 3: Create and Start the Migration Task

aws dms create-replication-task \ --replication-task-identifier oracle-to-aurora-task \ --source-endpoint-arn arn:aws:dms:...:endpoint/oracle-src \ --target-endpoint-arn arn:aws:dms:...:endpoint/aurora-target \ --migration-type full-load-and-cdc \ --table-mappings file://table-mappings.json \ --replication-task-settings file://task-settings.json

Then start it:

aws dms start-replication-task \ --replication-task-arn arn:aws:dms:...:task/oracle-to-aurora-task \ --start-replication-task-type start-replication

🔍 Pro Tips for DBAs:

  • Use --migration-type full-load-and-cdc to keep the target updated while users are still writing to the source.

  • Check task status & latency:

    aws dms describe-replication-tasks \ --filters "Name=replication-task-id,Values=oracle-to-aurora-task" \ --query "ReplicationTasks[*].{Status:Status,CDCStartTime:ReplicationStats.FullLoadProgressPercent}"
  • Always validate with:

    aws dms describe-table-statistics --replication-task-arn <task-arn>
  • Combine with AWS SCT (Schema Conversion Tool) for object conversion before DMS handles data replication.


💡 Bonus use case: You can repurpose DMS for ongoing replication — e.g., feeding an analytics cluster or keeping a DR instance up to date.

Curious — how many of you have used DMS for continuous sync rather than one-time migrations?

#AWS #DMS #DBA #CloudMigration #PostgreSQL #Oracle #AWSCLI #DataEngineering #DevOps

Friday, October 17, 2025

Useful AWS RDS CLI commands

 Here’s a list of very useful AWS RDS CLI commands using the AWS CLI, grouped by categories for ease of reference. These commands can help you manage your RDS instances, snapshots, security, and more efficiently.


🔍 Instance Management

1. List all RDS instances

aws rds describe-db-instances

2. Describe a specific RDS instance

aws rds describe-db-instances --db-instance-identifier <instance-id>

3. Create a new RDS instance

aws rds create-db-instance \ --db-instance-identifier mydbinstance \ --db-instance-class db.t3.micro \ --engine mysql \ --master-username admin \ --master-user-password MyPassword123 \ --allocated-storage 20

4. Modify an RDS instance

aws rds modify-db-instance \ --db-instance-identifier mydbinstance \ --allocated-storage 50 \ --apply-immediately

5. Delete an RDS instance

aws rds delete-db-instance \ --db-instance-identifier mydbinstance \ --skip-final-snapshot

💾 Snapshot Management

6. Create a snapshot

aws rds create-db-snapshot \ --db-snapshot-identifier mydb-snapshot-2025-10-17 \ --db-instance-identifier mydbinstance

7. List snapshots

aws rds describe-db-snapshots

8. Restore a DB from snapshot

aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier restored-db \ --db-snapshot-identifier mydb-snapshot-2025-10-17

📜 Parameter & Option Groups

9. List DB parameter groups

aws rds describe-db-parameter-groups

10. Modify a parameter in a parameter group

aws rds modify-db-parameter-group \ --db-parameter-group-name my-param-group \ --parameters "ParameterName=log_min_duration_statement,ParameterValue=1000,ApplyMethod=immediate"

🔐 Security & Access

11. List security groups for an instance

aws rds describe-db-instances \ --db-instance-identifier mydbinstance \ --query "DBInstances[*].VpcSecurityGroups[*].VpcSecurityGroupId" --output text

12. List RDS subnet groups

aws rds describe-db-subnet-groups

📊 Monitoring & Logs

13. List available log files

aws rds describe-db-log-files --db-instance-identifier mydbinstance

14. Download a specific log file

aws rds download-db-log-file-portion \ --db-instance-identifier mydbinstance \ --log-file-name error/mysql-error.log \ --starting-token 0

🔄 Automated Backups & Retention

15. Set backup retention period

aws rds modify-db-instance \ --db-instance-identifier mydbinstance \ --backup-retention-period 7 \ --apply-immediately

⏱️ Maintenance & Scheduling

16. List pending maintenance actions

aws rds describe-pending-maintenance-actions

🔁 Replication & Read Replicas

17. Create a read replica

aws rds create-db-instance-read-replica \ --db-instance-identifier mydb-replica \ --source-db-instance-identifier mydbinstance

18. Promote a read replica to standalone

aws rds promote-read-replica --db-instance-identifier mydb-replica

🛠️ General Helpers

19. List available DB engines

aws rds describe-db-engine-versions

20. List all instance classes

aws rds describe-orderable-db-instance-options --engine mysql

Wednesday, July 16, 2025

Step-by-Step Guide to become AWS DevOps Engineer

 Becoming an AWS DevOps engineer requires a combination of cloud knowledge, DevOps principles, and hands-on experience. Here's a step-by-step guide to help you along the way:

1. Understand the Basics of Cloud Computing & AWS

  • Learn Cloud Computing Concepts:

    • Understand the basics of cloud computing: what it is, types (IaaS, PaaS, SaaS), and benefits.

    • Learn about AWS and its services, including EC2, S3, VPC, IAM, RDS, etc.

    • Start with the AWS Free Tier to get hands-on experience with AWS services.

  • AWS Certified Cloud Practitioner:

    • This is an entry-level certification that covers AWS Cloud basics, which will give you a solid foundation before diving deeper into more advanced concepts.

    • Resources: AWS Training and Certification (free resources), A Cloud Guru, and AWS's own whitepapers.

2. Learn DevOps Fundamentals

  • Understand DevOps Principles:

    • Learn about Continuous Integration (CI), Continuous Delivery (CD), Infrastructure as Code (IaC), automation, monitoring, and feedback loops.

    • Focus on the cultural and organizational aspects of DevOps.

  • Learn Version Control:

    • Git is the most widely used version control system. Learn how to use Git and GitHub/GitLab/Bitbucket to manage code.

    • Master the concepts of branches, merges, pull requests, and commits.

3. Get Hands-on with AWS Core Services for DevOps

  • Compute and Networking:

    • Learn Amazon EC2, Auto Scaling, and Elastic Load Balancing (ELB) for scaling applications.

    • Familiarize yourself with Amazon VPC, Subnets, NAT Gateways, and Security Groups for networking.

  • Storage:

    • Learn Amazon S3 for object storage.

    • Understand Amazon EBS and Amazon EFS for block and file storage.

  • Database:

    • Learn Amazon RDS for managed relational databases.

    • Explore Amazon DynamoDB for NoSQL databases.

  • Security and Identity:

    • Master IAM (Identity and Access Management) to manage user permissions securely.

    • Learn about AWS KMS (Key Management Service) for managing encryption keys.

  • Monitoring and Logging:

    • Understand CloudWatch for monitoring AWS resources.

    • Learn how to use CloudTrail for logging and auditing API activity.

    • Learn about AWS X-Ray for tracing and debugging applications.

4. Learn Infrastructure as Code (IaC)

  • AWS CloudFormation:

    • Learn how to automate the creation of AWS resources using CloudFormation.

    • Study how to write and manage CloudFormation templates.

  • Terraform:

    • Although not exclusive to AWS, Terraform is widely used for IaC and works across multiple cloud providers.

    • Learn how to create, manage, and provision AWS infrastructure using Terraform.

  • Other Tools:

    • Explore AWS CDK (Cloud Development Kit) to define cloud infrastructure using code in languages like Python, TypeScript, and Java.

5. Learn CI/CD Tools & Practices

  • Jenkins:

    • Jenkins is a popular tool for automating CI/CD pipelines. Learn how to set up Jenkins servers, create Jenkinsfiles, and integrate with AWS services.

  • AWS CodePipeline:

    • AWS provides its own CI/CD service, CodePipeline, which integrates seamlessly with other AWS services like CodeCommit, CodeBuild, and CodeDeploy.

  • Docker and Kubernetes:

    • Learn Docker for containerization and understand the principles of building and running containers.

    • Familiarize yourself with Amazon EKS (Elastic Kubernetes Service) to deploy, manage, and scale Kubernetes clusters.

  • Other Tools:

    • Get hands-on with other tools like GitLab CI/CD, CircleCI, or Travis CI.

6. Learn Automation and Scripting

  • Bash/Shell Scripting:

    • Master the basics of Linux and write automation scripts using Bash or Shell.

  • Python/Scripting:

    • Python is widely used for automating tasks and interacting with AWS services using the Boto3 SDK.

  • AWS CLI:

    • Learn how to use the AWS Command Line Interface (CLI) for automating tasks and managing AWS resources.

7. Get Familiar with Monitoring & Logging

  • AWS CloudWatch:

    • Learn how to monitor and analyze logs and metrics in AWS using CloudWatch.

  • ELK Stack (Elasticsearch, Logstash, Kibana):

    • Although this is not AWS-native, it's a widely-used open-source toolset for monitoring and logging.

  • AWS X-Ray:

    • Learn to monitor and debug distributed applications running on AWS.

8. Gain Experience with Real-world Projects

  • Build a Full DevOps Pipeline:

    • Set up a CI/CD pipeline with GitHub, Jenkins, and AWS (CodePipeline, CodeBuild, CodeDeploy).

  • Containerization and Orchestration:

    • Create a Dockerized application and deploy it using Kubernetes on Amazon EKS.

  • Infrastructure Automation:

    • Automate the deployment of an entire infrastructure stack with CloudFormation or Terraform.

  • Monitoring:

    • Set up monitoring and logging using AWS CloudWatch, CloudTrail, and other tools to ensure system health.

9. Get Certified (Optional but Recommended)

  • AWS Certified DevOps Engineer – Professional:

    • This is the most relevant certification for an AWS DevOps engineer. It validates your skills in continuous delivery, automation, monitoring, and security in AWS environments.

    • Preparation: Take online courses, read AWS whitepapers, and review exam guides.

  • AWS Certified Solutions Architect – Associate:

    • If you’re new to AWS, this certification can also be helpful as it covers broader AWS concepts.

10. Keep Up with Industry Trends

  • Follow AWS Blogs:

    • AWS frequently releases new features, updates, and best practices. Follow the AWS Blog to stay informed.

  • Join Communities:

    • Participate in AWS-related forums, Reddit communities, and LinkedIn groups.

    • Attend AWS re:Invent and other conferences to network and stay updated on trends.

  • Contribute to Open Source:

    • Contributing to open-source projects related to DevOps can help you learn best practices and gain visibility.


Recommended Resources:

  • A Cloud Guru / Linux Academy – Offers great hands-on labs and courses tailored for AWS DevOps roles.

  • AWS Documentation – AWS’s own documentation is comprehensive and updated regularly.

  • Books:

    • “The Phoenix Project” (for DevOps culture)

    • “The DevOps Handbook” (for processes and tools)

    • “Infrastructure as Code” by Kief Morris (for IaC)

Final Thoughts

Becoming an AWS DevOps engineer takes time and dedication. Start by building a strong foundation in AWS and DevOps principles, then get hands-on experience through projects, certifications, and real-world practice. With continuous learning and hands-on experience, you’ll eventually become proficient in automating infrastructure, implementing CI/CD pipelines, and managing scalable, secure applications in the cloud.

Monday, April 28, 2025

AWS RDS Commands

 Here are some commonly used AWS RDS (Relational Database Service) commands using the AWS CLI, along with practical examples for each:


🔧 1. Create a New RDS Instance

aws rds create-db-instance \
--db-instance-identifier mydbinstance \ --db-instance-class db.t3.micro \ --engine mysql \ --master-username admin \ --master-user-password MySecurePassword123 \ --allocated-storage 20

📝 Creates a MySQL RDS instance with 20GB of storage.


🔍 2. Describe RDS Instances


aws rds describe-db-instances

📝 Lists all your RDS instances and their details.


🛑 3. Stop an RDS Instance (only supported for certain instance types)

aws rds stop-db-instance \
--db-instance-identifier mydbinstance

📝 Stops a running instance to save costs (only for non-multi-AZ).


▶️ 4. Start a Stopped RDS Instance


aws rds start-db-instance \ --db-instance-identifier mydbinstance

📝 Starts an RDS instance previously stopped.


🚫 5. Delete an RDS Instance

aws rds delete-db-instance \
--db-instance-identifier mydbinstance \ --skip-final-snapshot

📝 Deletes the RDS instance. Use --final-db-snapshot-identifier if you want a backup.


💾 6. Create a Snapshot

aws rds create-db-snapshot \
--db-snapshot-identifier mydbsnapshot \ --db-instance-identifier mydbinstance

📝 Creates a manual backup (snapshot) of your DB instance.


🔁 7. Restore from Snapshot

aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier restoredinstance \ --db-snapshot-identifier mydbsnapshot

📝 Restores a new DB instance from a snapshot.


🛡️ 8. Modify DB Instance (e.g., instance class)

aws rds modify-db-instance \
--db-instance-identifier mydbinstance \ --db-instance-class db.t3.small \ --apply-immediately

📝 Changes instance type and applies it immediately.


🌐 9. Create a Parameter Group

aws rds create-db-parameter-group \
--db-parameter-group-name myparamgroup \ --db-parameter-group-family mysql8.0 \ --description "My custom params"

📝 Used to customize DB settings, like enabling slow query logs.


📄 10. List Snapshots

aws rds describe-db-snapshots

📝 Displays available snapshots you can restore from.

Wednesday, March 26, 2025

Oracle OCI & AWS CLI commands

AWS CLI and OCI CLI commands side by side for easier comparison. Below table compares AWS and OCI CLI commands for similar actions across both platforms, helping you easily switch between them or use both in your multi-cloud environment.

AWS CLI Command OCI CLI Command
Configure AWS CLI: aws configure Configure OCI CLI: oci setup config
EC2: List Instances: aws ec2 describe-instances Compute: List Instances: oci compute instance list --compartment-id <compartment_ocid>
EC2: Start an Instance: aws ec2 start-instances --instance-ids <instance_id> Compute: Create an Instance: oci compute instance launch --compartment-id <compartment_ocid> --availability-domain <availability_domain> --shape <instance_shape> --image-id <image_ocid> --subnet-id <subnet_ocid> --display-name <instance_name>
EC2: Stop an Instance: aws ec2 stop-instances --instance-ids <instance_id> Compute: Stop an Instance: oci compute instance action --instance-id <instance_ocid> --action STOP
S3: List Buckets: aws s3 ls Object Storage: List Buckets: oci os bucket list --compartment-id <compartment_ocid>
S3: Upload a File: aws s3 cp <file> s3://<bucket_name>/<file_name> Object Storage: Upload a File: oci os object put --bucket-name <bucket_name> --name <object_name> --file <local_file_path>
S3: Download a File: aws s3 cp s3://<bucket_name>/<file_name> <file> Object Storage: Download a File: oci os object get --bucket-name <bucket_name> --name <object_name> --file <local_file_path>
IAM: List Users: aws iam list-users IAM: List Users: oci iam user list --compartment-id <compartment_ocid>
IAM: Create a User: aws iam create-user --user-name <user_name> IAM: Create a User: oci iam user create --compartment-id <compartment_ocid> --name <user_name> --description "<description>"
Lambda: List Functions: aws lambda list-functions Database: List Databases: oci db system list --compartment-id <compartment_ocid>
CloudWatch: List Alarms: aws cloudwatch describe-alarms Monitoring: List Alarms: oci monitoring alarm list --compartment-id <compartment_ocid>
CloudFormation: Describe Stacks: aws cloudformation describe-stacks Load Balancer: List Load Balancers: oci lb load-balancer list --compartment-id <compartment_ocid>
RDS: Describe DB Instances: aws rds describe-db-instances Load Balancer: Create a Load Balancer: oci lb load-balancer create --compartment-id <compartment_ocid> --shape <load_balancer_shape> --subnet-id <subnet_ocid> --display-name <load_balancer_name>
DynamoDB: List Tables: aws dynamodb list-tables Block Volume: List Volumes: oci bv volume list --compartment-id <compartment_ocid>
Route 53: List Hosted Zones: aws route53 list-hosted-zones Block Volume: Attach a Volume: oci bv volume attach --volume-id <volume_ocid> --instance-id <instance_ocid> --device <device_name>
SNS: List Topics: aws sns list-topics Autonomous Database: List Autonomous Databases: oci db autonomous-database list --compartment-id <compartment_ocid>
ECR: List Repositories: aws ecr describe-repositories Cloud Guard: List Security Problems: oci cloud-guard problem list --compartment-id <compartment_ocid>
Cost Explorer: Get Usage: aws ce get-cost-and-usage --time-period Start=2025-01-01,End=2025-01-31 --granularity DAILY --metrics "AmortizedCost" Database: Create a Database: oci db system launch --compartment-id <compartment_ocid> --availability-domain <availability_domain> --shape <db_shape> --subnet-id <subnet_ocid> --display-name <db_system_name> --database-edition <database_edition> --admin-password <admin_password>
STS: Get Caller Identity: aws sts get-caller-identity Compute: List Instances: oci compute instance list --compartment-id <compartment_ocid>
CloudTrail: Lookup Events: aws cloudtrail lookup-events --max-results 10 Compute: Stop an Instance: oci compute instance action --instance-id <instance_ocid> --action STOP
CloudFront: List Distributions: aws cloudfront list-distributions Object Storage: Upload a File: oci os object put --bucket-name <bucket_name> --name <object_name> --file <local_file_path>

Below is a table comparing AWS and OCI commands related to Networking. These commands cover networking services like Virtual Private Cloud (VPC) in AWS and Virtual Cloud Network (VCN) in OCI. This table compares networking-related AWS CLI and OCI CLI commands for similar tasks like managing VPCs/VCNs, subnets, security groups, route tables, VPNs, and more. For both platforms, these commands allow you to configure, manage, and troubleshoot your networking infrastructure effectively.

AWS CLI Command OCI CLI Command
VPC: Create VPC: aws ec2 create-vpc --cidr-block <cidr_block> VCN: Create a VCN: oci network vcn create --compartment-id <compartment_ocid> --cidr-block <cidr_block> --display-name <vcn_name>
VPC: List VPCs: aws ec2 describe-vpcs VCN: List VCNs: oci network vcn list --compartment-id <compartment_ocid>
VPC: Create Subnet: aws ec2 create-subnet --vpc-id <vpc_id> --cidr-block <cidr_block> VCN: Create a Subnet: oci network subnet create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --cidr-block <cidr_block> --availability-domain <availability_domain> --display-name <subnet_name>
VPC: List Subnets: aws ec2 describe-subnets --filters "Name=vpc-id,Values=<vpc_id>" VCN: List Subnets: oci network subnet list --compartment-id <compartment_ocid> --vcn-id <vcn_ocid>
VPC: Create Internet Gateway: aws ec2 create-internet-gateway VCN: Create an Internet Gateway: oci network internet-gateway create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --display-name <ig_name>
VPC: Attach Internet Gateway: aws ec2 attach-internet-gateway --vpc-id <vpc_id> --internet-gateway-id <ig_id> VCN: Attach an Internet Gateway: oci network vcn attach-internet-gateway --vcn-id <vcn_ocid> --internet-gateway-id <internet_gateway_ocid>
VPC: Create Route Table: aws ec2 create-route-table --vpc-id <vpc_id> VCN: Create a Route Table: oci network route-table create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --display-name <route_table_name>
VPC: List Route Tables: aws ec2 describe-route-tables --filters "Name=vpc-id,Values=<vpc_id>" VCN: List Route Tables: oci network route-table list --compartment-id <compartment_ocid> --vcn-id <vcn_ocid>
VPC: Create Route: aws ec2 create-route --route-table-id <route_table_id> --destination-cidr-block <cidr_block> --gateway-id <gateway_id> VCN: Create a Route in Route Table: oci network route-rule create --route-table-id <route_table_id> --destination <cidr_block> --network-entity-id <gateway_ocid>
VPC: Modify Route Table: aws ec2 replace-route --route-table-id <route_table_id> --destination-cidr-block <cidr_block> --gateway-id <gateway_id> VCN: Update Route Table: oci network route-rule update --route-table-id <route_table_id> --route-rule-id <route_rule_id> --destination <cidr_block> --network-entity-id <gateway_ocid>
VPC: Delete Subnet: aws ec2 delete-subnet --subnet-id <subnet_id> VCN: Delete Subnet: oci network subnet delete --subnet-id <subnet_ocid>
VPC: Delete Internet Gateway: aws ec2 delete-internet-gateway --internet-gateway-id <ig_id> VCN: Delete Internet Gateway: oci network internet-gateway delete --internet-gateway-id <internet_gateway_ocid>
VPC: Create Security Group: aws ec2 create-security-group --group-name <group_name> --description <description> --vpc-id <vpc_id> VCN: Create a Security List (OCI equivalent of Security Group): oci network security-list create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --display-name <security_list_name>
VPC: List Security Groups: aws ec2 describe-security-groups --filters "Name=vpc-id,Values=<vpc_id>" VCN: List Security Lists: oci network security-list list --compartment-id <compartment_ocid> --vcn-id <vcn_ocid>
VPC: Create Network ACL: aws ec2 create-network-acl --vpc-id <vpc_id> VCN: Create a Network Security Group: oci network network-security-group create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --display-name <nsg_name>
VPC: Attach Network ACL: aws ec2 associate-network-acl --network-acl-id <acl_id> --subnet-id <subnet_id> VCN: Attach a Network Security Group: oci network network-security-group add-vnics --network-security-group-id <nsg_id> --nics <nic_ocid>
VPC: Create VPC Peering: aws ec2 create-vpc-peering-connection --vpc-id <vpc_id> --peer-vpc-id <peer_vpc_id> VCN: Create VCN Peering: oci network vcn-peering-connection create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --peer-vcn-id <peer_vcn_ocid> --display-name <peering_name>
VPC: Accept VPC Peering: aws ec2 accept-vpc-peering-connection --vpc-peering-connection-id <peering_id> VCN: Accept VCN Peering: oci network vcn-peering-connection accept --vcn-peering-connection-id <peering_ocid>
VPC: Delete VPC Peering: aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id <peering_id> VCN: Delete VCN Peering: oci network vcn-peering-connection delete --vcn-peering-connection-id <peering_ocid>
VPC: Create VPN Gateway: aws ec2 create-vpn-gateway --type <vpn_type> --amazon-side-asn <asn> VCN: Create a VPN Gateway: oci network vpn-gateway create --compartment-id <compartment_ocid> --vcn-id <vcn_ocid> --display-name <vpn_gateway_name>
VPC: Attach VPN Gateway: aws ec2 attach-vpn-gateway --vpc-id <vpc_id> --vpn-gateway-id <vpn_gateway_id> VCN: Attach a VPN Gateway: oci network vpn-gateway attach --vcn-id <vcn_ocid> --vpn-gateway-id <vpn_gateway_ocid>
VPC: List VPN Gateways: aws ec2 describe-vpn-gateways VCN: List VPN Gateways: oci network vpn-gateway list --compartment-id <compartment_ocid>

Here’s a comparison table of AWS CLI and OCI CLI commands related to backup and restore from snapshots for both AWS and OCI. These commands cover common actions like creating snapshots, listing snapshots, and restoring from them.

AWS CLI Command OCI CLI Command
EC2: Create Snapshot (Backup an EBS volume): aws ec2 create-snapshot --volume-id <volume_id> --description "<description>" Block Volume: Create Snapshot (Backup an EBS volume in OCI): oci bv volume-create-backup --volume-id <volume_id> --display-name "<snapshot_name>" --description "<description>"
EC2: Describe Snapshots (List snapshots): aws ec2 describe-snapshots --owner-ids <owner_id> Block Volume: List Snapshots (List backups of block volumes): oci bv backup list --compartment-id <compartment_ocid>
EC2: Delete Snapshot (Delete a snapshot): aws ec2 delete-snapshot --snapshot-id <snapshot_id> Block Volume: Delete Snapshot (Delete a backup): oci bv backup delete --backup-id <backup_id>
EC2: Restore from Snapshot (Create volume from snapshot): aws ec2 create-volume --snapshot-id <snapshot_id> --availability-zone <availability_zone> Block Volume: Restore from Snapshot (Create a new volume from a snapshot): oci bv volume restore --backup-id <backup_id> --availability-domain <availability_domain> --compartment-id <compartment_ocid>
RDS: Create Snapshot (Backup an RDS instance): aws rds create-db-snapshot --db-instance-identifier <db_instance_id> --db-snapshot-identifier <snapshot_name> Autonomous Database: Create a Backup (Autonomous DB snapshot in OCI): oci db autonomous-database backup create --autonomous-database-id <autonomous_db_ocid> --display-name <backup_name>
RDS: Describe Snapshots (List RDS snapshots): aws rds describe-db-snapshots --db-instance-identifier <db_instance_id> Autonomous Database: List Backups (List backups of Autonomous Database): oci db autonomous-database backup list --compartment-id <compartment_ocid>
RDS: Delete Snapshot (Delete an RDS snapshot): aws rds delete-db-snapshot --db-snapshot-identifier <snapshot_id> Autonomous Database: Delete a Backup (Delete Autonomous DB backup): oci db autonomous-database backup delete --autonomous-database-id <autonomous_db_ocid> --backup-id <backup_id>
RDS: Restore from Snapshot (Restore an RDS instance from snapshot): aws rds restore-db-instance-from-db-snapshot --db-instance-identifier <new_db_instance_id> --db-snapshot-identifier <snapshot_id> Autonomous Database: Restore from Backup (Restore Autonomous DB from backup): oci db autonomous-database restore-from-backup --autonomous-database-id <autonomous_db_ocid> --backup-id <backup_id>

Key Points:

  • AWS EC2 primarily uses EBS snapshots for backup and restore of volumes. You can create a volume from a snapshot to restore it.

  • AWS RDS provides an option to create and restore database snapshots for RDS instances.

  • OCI Block Volume uses volume backups (backups of block volumes) to manage snapshots, and you can restore from backups to a new volume.

  • OCI Autonomous Database allows backup creation and restore for Autonomous Databases via backups.

Both AWS and OCI offer similar snapshot and restore functionalities but with slight differences in the specific commands and services they offer for database and block volume backups.