GithubHelp home page GithubHelp logo

cloudnativetech / gdg-terraform-gcp-workshop Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 23.0 955 KB

Google Cloud Platform(GCP) and Terraform examples for GDG London workshop

License: Apache License 2.0

HCL 77.89% HTML 7.41% Shell 14.70%
terraform gcp google-cloud-platform google-cloud-compute google-cloud-storage infrastructure-as-code gdglondon

gdg-terraform-gcp-workshop's Introduction

Google Cloud Platform(GCP) and Terraform workshop at GDG London

This repository contains terraform examples to manage infrastructure on Google Cloud Platform(GCP).

โš ๏ธ WARNING: Running examples in this repository may incur charges on your GCP account. We cannot be responsible for any charges you may incur.

Prerequisite

  1. Linux or MAC workstation.
  2. wget package installed on your workstation.
  3. Python 2.7 is installed.

How to install Terraform?

  1. Download terraform package from terraform.io/downloads.
wget https://releases.hashicorp.com/terraform/0.12.15/terraform_0.12.15_linux_amd64.zip -O /tmp/terraform.zip
  1. Unzip the terraform binary to a directory which is included in your system PATH.
sudo unzip /tmp/terraform.zip -d /usr/local/bin/
  1. Reload your shell.
exec -l $SHELL
  1. Verify installation.
terraform --help

How to install Google Cloud SDK?

  1. Set the directory for google-cloud-sdk.
export GCLOUD_PATH=$HOME

NOTE: You can change from $HOME to any directory path you want.

  1. Download google-cloud-sdk.
    For MAC users:
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-271.0.0-darwin-x86_64.tar.gz -O $GCLOUD_PATH/google-cloud-sdk.tar.gz

For Linux users:

wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-271.0.0-linux-x86_64.tar.gz -O $GCLOUD_PATH/google-cloud-sdk.tar.gz
  1. Extract the downloaded package.
cd $GCLOUD_PATH
tar -zxvf google-cloud-sdk.tar.gz
  1. Run install.sh script to add Google Cloud SDK to your path.
./google-cloud-sdk/install.sh
  1. Reload Shell.
exec -l $SHELL

How to initialize Google Cloud SDK?

  1. Initialize the SDK.
gcloud init
  1. Accept to login to your Google account.
To continue, you must login. Would you like to log in (Y/n)? Y
  1. This will open your browser and prompt for permissions. Login with your Google account credentials and Allow.

  2. Select the preferred project and zone.

  3. You should now see the following message for successful initialization.

gcloud has now been configured!
You can use [gcloud config] to change more gcloud settings.

Your active configuration is: [default]
  1. Verify initialization.
gcloud auth list

How to run Terraform project?

  1. Generate google authentication token.
gcloud auth application-default login
  1. Navigate to terraform project directory.

  2. Fill the code where mentioned Update:

  3. Initialize terraform project.

terraform init
  1. Generate terraform execution plan.
terraform plan
  1. Run terraform apply, if plan looks good.
terraform apply
  1. For clean-up, destroy all the resources created by terraform.
terraform destroy

To revoke gcloud access from terminal

Run following command to revoke GCP credential from command-line.s

$> gcloud auth revoke
Note: Always remember to cleanup resources when NOT needed to avoid additional charges.

LICENSE

Please see LICENSE.txt

gdg-terraform-gcp-workshop's People

Contributors

pradeepbhadani avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

gdg-terraform-gcp-workshop's Issues

error in cmd in README.md

While running through the commands in README.md,
Under: How to install Google Cloud SDK? step1
getting error when running in ubuntu
export $GCLOUD_PATH=$HOME
bash: export: `/home/nicholas=/home/nicholas': not a valid identifier

The fix is:
export GCLOUD_PATH=$HOME

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.