Giter Club home page Giter Club logo

script-to-identify-shared-vpc's Introduction

Share VPC Script

share-vpc.sh is a script developed to help automate the sharing of VPC networks and subnets with other projects in GCP.

Disclaimer

This tool is provided without any warranty, make sure you review the script code and test accordingly with your requirements. Always make sure you have backups and have validated recovery from those backups before running, especially in production environments.

Getting Started

  • Make sure you know the host project id, child project id , and finally the network and subnet you wish to share.
  • Clone the repository, and make sure you install the Google cloud SDK (or, just run the script from CloudShell).
  • If running outside of cloud shell, authenticate by running "gcloud auth login"
  • Use format:
    • ./share-vpc.sh -h <host project> -c <child project> -n <network to share> -s <subnet to share>

Required options

  • -h <host project>: This is the project ID of the host project, which will share its networks and subnets with other child projects"
  • -c <child project>: Project ID of the child project, who will create resources in the parent project's network and subnets"
  • -n <network to share>: Name of the network in the host project that will be shared"
  • -s <subnet to share>: The specific subnet name you wish to share"

Optional flags

  • -k: Enables kubernetes integration for GKE to access the shared subnets
  • -z: Run the script in "ZOMG" mode, which bypasses all the preflight checks and will attempt to run as-is. HIGHLY discouraged in production.

Examples:

./share-vpc.sh -h shared-svc-project -c my-app-project -n shared-vpc-network -s app-project-subnet    
   - This share the subnet 'app-project-subnet' with the my-app-project, allowing resources to connect to the shared-vpc-network

./share-vpc.sh -h shared-svc-project -c my-app-project -n shared-vpc-network -s app-project-subnet -k -z    
   - Same share as 1st example, but now we are running in 'ZOMG' mode (-z), where validation is skipped.
   - Enabled GKE sharing with the -k flag, where GKE clusters in child project may now access the subnet 'app-project-subnet'

Authors

License

This project is licensed under the Apache 2 License - see the LICENSE.md file for details

script-to-identify-shared-vpc's People

Contributors

vanberge avatar

Watchers

 avatar

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.