Giter Club home page Giter Club logo

ollionorg / gcp-landing-zone Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 9.0 4.88 MB

Leverage Ollion's GCP Landing Zone to deploy a secure, compliant foundation with ease. The repository contains an implementation of a secure and compliant landing zone pattern that will help expedite cloud migration for an enterprise in a heavily regulated industry.

License: Apache License 2.0

HCL 65.50% Shell 3.88% JavaScript 0.55% HTML 0.04% Python 1.69% Vue 9.95% Smarty 0.01% Dockerfile 0.27% Go 0.21% Open Policy Agent 17.90%
cloud-compliance cloud-security compliance foundation gcp gcp-landing-zones nist800-53 opa pci-dss regula

gcp-landing-zone's Introduction

OLLION

Google Cloud Foundation Landing Zone

Documentation License Discord Reports

This repository contains the Terraform code necessary to set up a Landing Zone using the Google Cloud Platform (GCP). It is designed to follow best practices outlined in the Google Cloud Architecture's Security Foundations. By leveraging this code, users can create a secure, scalable, and efficient cloud environment that aligns with Google's recommended practices.

Landing Zone User Guide

Repository Directory Structure

To maintain organization and facilitate navigation, this repository is structured as follows:

repo:
|- 0-bootstrap
   |- <terraform_code>
|- 1-org
   |- <terraform_code>
|- 2-env
   |- <terraform_code>
|- 3-networks
   |- <terraform_code>
|- 4-projects
   |- <terraform_code>
|- 5-app-infra
   |- <terraform_code>
|- 6-anthos
   |- <application_manifests>   
|- kcc
   |- <terraform_code>
   |- <resource_manifests>
|- modules
   |- <terraform_module_folder_1>
   |- <terraform_module_folder_2>

Software Prerequisites

To run the commands described in this document, you need to have the following installed:

  • Google Cloud SDK: Version 319.0.0 or later. Install Guide
  • Terraform: Version 1.0.9. Download
  • Git: Version v2.38.1

Prerequisites

Before you begin deploying the Landing Zone, ensure you have the following prerequisites in place:

Note: Consistency in Terraform version is crucial to avoid state lock errors. Follow the steps below to set up your environment correctly:

  1. Google Cloud Organization: Set up as described here.
  2. Billing Account: Create and manage as per instructions here. Remember to:
    • Note the billing ID.
    • Increase the quota for associating projects to 50.
  3. Authentication: Configure by creating Cloud Identity or Google Workspace groups for admins.
  4. Permissions: Create a group_org_admins group and assign necessary roles including
    • roles/resourcemanager.projectCreator
    • roles/resourcemanager.folderCreator
    • roles/resourcemanager.organizationAdmin
    • roles/billing.admin.
  5. Service Accounts: Ensure GitHub Actions and Cloud Build service accounts are added to the group_org_admins.

For a detailed setup, refer to the organization bootstrap module documentation.

Deployment Process

Step 0 - Forking Github repo

Follow the steps to fork or clone the landing zone GITHUB repo on your local machine:

  1. Create bot machine user and create a personal access token (PAT) on GitHub for user . Grants access to PAT as following permission read:org and read:discussions.
    Goto GitHub profile > Settings > Developer Settings > Personal Access Tokens > Generate New Token. Note the new token value.
  2. Create GitHub Token Secret in GitHub as GH_TOKEN.
  3. Clone the repo:
    git clone https://github.com/ollionorg/gcp-landing-zone.git
    

Step 1 - Collect configuration information

The following steps should be executed on your local system to initialize and run the bootstrap phase for the GCP landing zone.

  1. Ensure the tf variable file inside the file 0-bootstrap/terraform.tfvars are properly set and commit the changes to the repository. For setting the parameters, please refer to the input documentation.
  2. Add correct billing ID in the 0-bootstrap/terraform.tfvars file for the initial deployment of the 0-bootstrap stage.
  3. Optional if required, Create Slack WebHook Secret in GitHub GCF_SLACK_WEBHOOK.
  4. Setup GH_TOKEN as $GITHUB_PAT environment variable and execute the wrapper script using below commands (Ensure .terraform directories created locally from previous runs are deleted):
       $ cd ./prerequisites/scripts
    
          $ read -s token
          <enter_github_token_obtained_in_step_9>
    
          $ export GITHUB_PAT=$token
    
          $ chmod +x wrapper.sh ; ./wrapper.sh
    
  5. After execution of wrapper script, add cloudbuild service account from cicd project as a principal in the billing account with billing.administrator and billing.user
  6. Wrapper script will create following branch protection rules for branch ${bu_name}-main.
    Require a pull request before merging.
    Required two number of approvals before merging
    Dismiss stale pull request approvals when new commits are pushed
    Require review from Code Owners
    Require status checks to pass before merging
    Require branches to be up to date before merging
    Require conversation resolution before merging.
    Require signed commits.
    Requires administrator
    Allow auto-merge and allow auto-deletion of branches
    
  7. Commit and push changes from .github/workflows, build, 0-bootstrap, README.md to ${bu_name}-init and ensure everything gets successfully applied.
  8. Start deployment by raising PRs for subsequent stages by pushing the backend.tf changes made by wrapper script for each stage in ${bu_name}-init.

Troubleshooting

Describe the problem clearly and send an email to [email protected].

gcp-landing-zone's People

Contributors

akashcldcvr avatar amansingh14 avatar ariesyous avatar cldcvr-audit avatar dependabot[bot] avatar sanketnadkarni avatar sujatak97 avatar tradark avatar vishal-kapse avatar viveky1098 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gcp-landing-zone's Issues

Broken links in readme.md

Hey folks, wanted to dig more into this but noticed a lot of broken links in the readme, specifically the links to the yaml's and the troubleshooting link at the bottom.

Ensure oslogin is enabled for a Project

Fix:

  resource "google_compute_project_metadata_item" "allowed" {
  project = google_project.main.number
  key   = "enable-oslogin"
  value = true
}

The above code should be added to `core_project_factory. To fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.