AWS · GOOGLE CLOUD · TERRAFORM

Cloud infrastructure built as code and delivered through GitLab.

We build AWS and Google Cloud environments with Terraform, reviewed in merge requests and applied by GitLab pipelines, so every change is planned, approved, repeatable and recorded. Azure is supported with the same approach.

TOOLS IN THIS SOLUTION

Common technologies and the role each can play.

  • TerraformInfrastructure as code
  • AWSCloud infrastructure
  • Google CloudCloud infrastructure
  • GitLabReview and delivery

Tools are selected for your environment. Product names identify the technologies discussed and do not imply endorsement.

Terraform workflow: merge request, validate, scan, plan, approve, apply; state stored in S3 or GCS; GitLab authenticates to AWS and Google Cloud with OIDC; scheduled drift detectionMerge requestChange to .tf codeValidatefmt · validateTFLintScanCheckovTrivy configPlanSaved plan fileShown on the MRApproveCode owner reviewProtected envApplyExact saved planMain branch onlyShort-lived credentialsGitLab OIDC id_token →AWS IAM role / GCP WIFRemote state + lockingAWS: S3 backend (lockfile)GCP: GCS backendAWSaccounts:dev · stg · prodGoogle Cloudprojects:dev · stg · prodScheduled drift checkplan-only pipeline, alerts on changeno long-lived cloud keys stored in GitLab
Infrastructure changes go through the same review as application code: validated, scanned, planned on the merge request, approved, then applied from the protected branch. A scheduled pipeline checks for drift.

AWS and Google Cloud building blocks

We choose managed services that suit the workload, and keep the Terraform structure the same on either cloud.

CapabilityAWSGoogle Cloud
Accounts / isolationAWS Organizations, accounts per environmentResource hierarchy, projects per environment
NetworkingVPC, subnets, NAT gateway, security groupsVPC, subnets, Cloud NAT, firewall rules
KubernetesAmazon EKSGoogle Kubernetes Engine (GKE)
Virtual machinesAmazon EC2, Auto Scaling groupsCompute Engine, managed instance groups
Serverless containersECS on Fargate, App RunnerCloud Run
Container registryAmazon ECRArtifact Registry
DatabasesAmazon RDS, AuroraCloud SQL, AlloyDB
Object storageAmazon S3Cloud Storage
SecretsSecrets Manager, KMSSecret Manager, Cloud KMS
CI/CD identityIAM role trusted via GitLab OIDCWorkload Identity Federation
Terraform stateS3 backend with lockfileGCS backend

How we structure Terraform

Reusable modules

Network, cluster, database and monitoring modules are versioned and shared by every environment.

Isolated environments

Separate state, accounts or projects for dev, staging and production limit the impact of any change.

Plan on every MR

Reviewers see exactly what will change; apply uses the saved plan from the approved pipeline.

Policy as code

Checkov and TFLint catch insecure or non-standard resources before they are created.

No static keys

GitLab OIDC tokens are exchanged for short-lived AWS or Google Cloud credentials per job.

Drift detection

A scheduled plan-only pipeline reports changes made outside Terraform.

Repository layout
infra/
├── modules/            # reusable, versioned building blocks
│   ├── network/        # VPC, subnets, NAT, firewall rules
│   ├── cluster/        # EKS or GKE, node pools, IAM bindings
│   ├── database/       # RDS or Cloud SQL, backups, access
│   └── observability/  # Prometheus, Loki, Grafana stack
└── envs/
    ├── dev/            # same modules, smaller sizes
    ├── staging/
    └── prod/           # stricter policies, approvals required
Remote state with locking
terraform {
  backend "s3" {                    # AWS
    bucket       = "example-terraform-state"
    key          = "prod/network.tfstate"
    region       = "ap-south-1"
    encrypt      = true
    use_lockfile = true             # S3-native state locking
  }
}

# Google Cloud equivalent:
# terraform {
#   backend "gcs" {
#     bucket = "example-terraform-state"
#     prefix = "prod/network"
#   }
# }

Want this running in your team?

Tell us about your stack, cloud and delivery goals. We will propose a scope, a timeline and the first quick wins.

Start a conversation