> For the complete documentation index, see [llms.txt](https://freundcloud.gitbook.io/devops-examples-from-real-life/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freundcloud.gitbook.io/devops-examples-from-real-life/cloud-platforms/public-clouds/aws-gcp.md).

# AWS to GCP

Migrating from Amazon Web Services (AWS) to Google Cloud Platform (GCP) requires careful planning, mapping of services, and process adaptation. This guide provides actionable steps, real-life examples, and best practices for a successful migration.

***

## Quick Comparison: AWS vs GCP Services

| AWS Service    | GCP Equivalent          | Notes                                  |
| -------------- | ----------------------- | -------------------------------------- |
| EC2            | Compute Engine          | VM types and images differ             |
| S3             | Cloud Storage           | APIs and access models vary            |
| IAM            | Cloud IAM               | RBAC and identity federation differ    |
| RDS            | Cloud SQL               | Migration tools available              |
| Lambda         | Cloud Functions         | Triggers and bindings differ           |
| CloudFormation | Deployment Manager      | Syntax and capabilities differ         |
| CloudWatch     | Stackdriver Monitoring  | Metrics and logging integration varies |
| VPC            | VPC                     | Subnet and peering models differ       |
| EKS            | GKE (Kubernetes Engine) | Cluster management differs             |
| Route 53       | Cloud DNS               | Record types and automation differ     |

> **Tip:** [GCP's AWS to GCP service mapping](https://cloud.google.com/docs/compare/aws)

***

## Migration Checklist

* [ ] **Inventory AWS Resources**\
  Use AWS CLI:\
  `aws resourcegroupstaggingapi get-resources > aws-inventory.json`
* [ ] **Map AWS Services to GCP Equivalents**\
  Create a mapping table for all services in use.
* [ ] **Assess Application Dependencies**\
  Identify hardcoded endpoints, region-specific services, and OS dependencies.
* [ ] **Plan Identity and Access Migration**\
  Prepare to migrate IAM users/groups to Cloud IAM.
* [ ] **Network Planning**\
  Design GCP VPCs to match or improve your AWS VPC topology.
* [ ] **Translate Infrastructure as Code**\
  Convert CloudFormation templates to Deployment Manager or Terraform.
* [ ] **Migrate Data**\
  Use gsutil or Storage Transfer Service for storage migration.
* [ ] **Migrate Identity**\
  Set up Cloud IAM, and test user access.
* [ ] **Refactor Applications**\
  Update code/configs to use GCP SDKs and endpoints.
* [ ] **Test and Validate**\
  Use Stackdriver Monitoring and Logging for validation.
* [ ] **Update DNS**\
  Point domains to GCP endpoints (Cloud DNS).
* [ ] **Monitor and Optimize**\
  Use GCP Cost Management and Recommender.
* [ ] **Decommission AWS Resources**\
  Confirm all data is migrated and backups are complete before deleting.
* [ ] **Update Documentation**\
  Revise runbooks and architecture diagrams.

***

## Migration Steps (with Examples)

### 1. Infrastructure as Code (IaC) Translation

* **Example:** Convert CloudFormation templates to Deployment Manager or Terraform.
  * Use [Former2](https://former2.com/) to export AWS resources to Terraform, then adapt to GCP.
  * Example Terraform snippet for GCP VM:

    ```hcl
    resource "google_compute_instance" "example" {
      name         = "example-vm"
      machine_type = "e2-medium"
      zone         = "us-central1-a"
      # ...
    }
    ```

### 2. Data Migration

* **Example:** Migrate S3 buckets to Cloud Storage using [gsutil](https://cloud.google.com/storage/docs/gsutil/commands/cp):

  ```sh
  gsutil -m cp -r s3://mybucket gs://my-gcp-bucket
  ```

### 3. Identity Migration

* **Example:** Sync AWS IAM users to Cloud IAM using [Workforce Identity Federation](https://cloud.google.com/iam/docs/workforce-identity-federation).

### 4. Application Refactoring

* Update code/configs to use GCP SDKs and endpoints.
* Replace AWS Lambda triggers with Cloud Functions triggers.

### 5. Testing and Validation

* Use Stackdriver Monitoring and Logging for post-migration validation.

***

## Post-Migration Tasks

* **Update DNS:** Point domains to GCP endpoints (e.g., Cloud DNS).
* **Monitor and Optimize:** Use GCP Cost Management and Recommender.
* **Decommission AWS Resources:** Ensure all data is migrated and backups are complete before deleting.
* **Documentation:** Update runbooks and architecture diagrams.

***

## Best Practices & Common Pitfalls

* **Start with Non-Production Workloads:** Validate migration steps before moving critical systems.
* **Automate Everything:** Use Terraform/Ansible for repeatable deployments.
* **Watch for Service Limits:** GCP and AWS have different quotas.
* **Security Review:** Reassess security groups, firewall rules, and IAM/RBAC policies.

***

## Cloud Hopping Humor

> Why did the DevOps engineer take a surfboard to the AWS to GCP migration?
>
> Because they heard the best waves are in the Google Cloud!

***

## References

* [AWS to GCP Service Comparison](https://cloud.google.com/docs/compare/aws)
* [GCP Migration Center](https://cloud.google.com/migrate/)
* [Terraform GCP Provider Docs](https://registry.terraform.io/providers/hashicorp/google/latest/docs)
* [gsutil Documentation](https://cloud.google.com/storage/docs/gsutil)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://freundcloud.gitbook.io/devops-examples-from-real-life/cloud-platforms/public-clouds/aws-gcp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
