{"id":512730,"date":"2022-03-07T10:36:37","date_gmt":"2022-03-07T09:36:37","guid":{"rendered":"https:\/\/www.devoteam.com\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/"},"modified":"2025-04-10T15:44:21","modified_gmt":"2025-04-10T13:44:21","slug":"a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform","status":"publish","type":"expert-view","link":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/","title":{"rendered":"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/Banner_stepbystepguide_GCP_terraform.jpg\" alt=\"\" class=\"wp-image-28278\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">What will you learn?&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.&nbsp;<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">What do you need before starting?&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To follow this guide you must be familiar with the G Cloud Console and have some basic understanding of GCP services such as IAM and Cloud Storage. You need to have cloud storage creation permissions and an IAM role.<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Let&#8217;s get started<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Set up your G Cloud Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Set up your G Cloud Configuration to use the project that you will be working with.&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud config set project PROJECT_ID<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is to set your own user credentials for Terraform in order to access the APIs:&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud auth application-default login<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Create a service account for your project&nbsp;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We recommend you to use the following naming convention: <em>sa-{short_project_name}-tf-{Environment}<\/em>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tip: The short name can be something related to the project name you are using.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The name of my service account is sa-demo-tf-sbx&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Demo: my project is called demo-playground&nbsp;<\/li><li>Sbx: the environment I\u2019m using is called sandbox&nbsp;<\/li><\/ul>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud iam service-accounts create sa-demo-tf-sbx <br>&#8211;description=&#8221;Terraform Service account Demo Sandbox Environment&#8221;<br><br>&#8211;display-name=&#8221;Terraform Service Account&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Provide your freshly created service account with the necessary roles and permissions <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will now provide the service account with the necessary roles and permissions. We will be granting the project Editor permission for a full list of possible roles you that can find <a href=\"https:\/\/cloud.google.com\/iam\/docs\/understanding-roles\">here<\/a>.&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud projects add-iam-policy-binding PROJECT_ID <br>&#8211;member=&#8221;serviceAccount:sa-demo-tf-<br>sbx@PROJECT_ID.iam.gserviceaccount.com&#8221; <br>&#8211;role=&#8221;roles\/editor&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will be impersonating this service account to make all our changes. In order to do this, we need to grant ourselves the necessary permissions. You can do it like this:&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3.1. First: get the policies for the service account and save it in policy.json<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud iam service-accounts get-iam-policy sa-demo-tf-<br>sbx@PROJECT_ID.iam.gserviceaccount.com <br>&#8211;format=json &gt; policy.json<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3.2. Modify the policy.json to add yourself as member to the role (roles\/iam.serviceAccountTokenCreator). Remember to append the rest of policies that already exist: <\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:300\">{<br>&#8220;bindings&#8221;: [<br>{<br>&#8220;members&#8221;: [<br>&#8220;user:user_name@domain.com&#8221;<br>],<br>&#8220;role&#8221;: &#8220;roles\/iam.serviceAccountTokenCreator&#8221;<br>}<br>],<br>\u2026<br>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3.3. Update the policies with the policy.json file <\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gcloud iam service-accounts set-iam-policy sa-demo-tf-<br>sbx@PROJECT_ID.gserviceaccount.com <br>policy.json<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Create a bucket that will hold your Terraform Stat<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now choose the name of the bucket. You can use this naming convention: <em>{short_project_name}-{Environment}-tf-state<\/em>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example: in this case it will be <em>demo &#8211; sbx &#8211; tf- state&nbsp;<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This bucket will help you to keep the Terraform state in a location that is shared across all developers. It is a good practice to keep the states of Terraform with versioning.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">gsutil mb -l gs:\/\/demo-sbx-tf-state<br>gsutil versioning set on gs:\/\/demo-sbx-tf-state<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Write the Terraform Main <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s write the Terraform Main. In order to do this we will need:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A Terraform Main&nbsp;<\/li><li>A Tfvars&nbsp;<\/li><li>A couple of files&nbsp;<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Are you unsure how to structure the Terraform code? Then use this as a starting point.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For now we will focus on the main.tf, gcp-demo-sbx.tfvars, demo-, sbx.backend and variables.tf.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">tf-code<br>\u2502 main.tf<br>\u2502 gcp-demo-sbx.tfvars<br>\u2502 gcp-demo-sbx.backend<br>\u2502 variables.tf<br>\u2502 version.tf<br>\u2502<br>\u2514\u2500\u2500\u2500module1<br>\u2502 \u2502 main.tf<br>\u2502 \u2502 outputs.tf<br>\u2502 \u2502 varialbes.tf<br>\u2502<br>\u2514\u2500\u2500\u2500module2<br>\u2502 \u2502 main.tf<br>\u2502 \u2502 outputs.tf<br>\u2502 \u2502 varialbes.tf<br>\u2502<br>\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.1. Main.tf <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the main of our Terraform code. We will be using the <a href=\"https:\/\/registry.terraform.io\/providers\/hashicorp\/google\/3.64.0\/docs\/guides\/getting_started\">Google Provider<\/a>. Use the following code as starting point:&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">provider &#8220;google&#8221; {<br>project = var.project_id<br>region = var.region<br>zone = var.zone<br>impersonate_service_account = var.tf_service_account<br>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.2. Gcp-demo-sbx.tfvars&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fill this with the variables that can be used for each environment.<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">project_id = &#8220;demo-sbx-tf-state&#8221;<br>region = &#8220;europe-west1&#8221;<br>zone = &#8220;europe-west1-b&#8221;<br>tf_service_account = &#8220;sa-demo-tf-<br>sbx@PROJECT_ID.iam.gserviceaccount.com&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.3. Gcp-demo-sbx.backend<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This file contains the definition of the backend, the bucket name, the prefix to use to save the state and the service account to impersonate. <\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">bucket = &#8220;demo-sbx-tf-state&#8221;<br>prefix = &#8220;static.tfstate.d&#8221;<br>impersonate_service_account = &#8220;sa-demo-tf-<br>sbx@PROJECT_ID.iam.gserviceaccount.com&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5.4. Version.tf&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This will enable you to keep track of exactly which version of Terraform you are using and each provider that is required. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\"><em>#### Configure backend ####<\/em><br>terraform {<br>required_version = &#8220;~&gt;0.14.0&#8221;<br>backend &#8220;gcs&#8221; {}<br>required_providers {<br>google = {<br>source = &#8220;hashicorp\/google&#8221;<br>version = &#8220;~&gt;3.64.0&#8221;<br>}<br>}<br>}<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Initialise the Terraform code&nbsp;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is to initialise the Terraform code using the following command:<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">terraform init -backend-config=gcp-demo-sbx.backend<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. Create a workspace <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can create a workspace. <a href=\"https:\/\/www.terraform.io\/language\/state\/workspaces\" target=\"_blank\" rel=\"noreferrer noopener\">Workspaces<\/a> should be created for each environment.&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">terraform workspace new gcp-demo-sbx<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">8. Plan and apply <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can plan and apply the solution.&nbsp;<\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#efeeee;font-style:normal;font-weight:200\">terraform plan &#8211;out tf.plan &#8211;var-file=gcp-demo-sbx.tfvars<\/p>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Next steps <\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>It is possible to leverage the IAM module from the Google Cloud Provider to manage all your permissions.&nbsp;<\/li><li>Migrate your current setup using <a href=\"https:\/\/cloud.google.com\/sdk\/gcloud\/reference\/beta\/resource-config\/bulk-export\">bulk export<\/a> to Terraform<\/li><\/ul>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\">Conclusion <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You can now set up Terraform and set up its backend in the GCP Cloud Storage. Do you want to learn more or get help from our experts? Get in touch <a href=\"https:\/\/gcloud.devoteam.com\/contact-us\/\">here<\/a>.&nbsp;<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>What will you learn?&nbsp; In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.&nbsp; What do you need before starting?&nbsp; To follow this guide you must be familiar with the G Cloud Console and have some basic [&hellip;]<\/p>\n","protected":false},"featured_media":287515,"template":"","categories":[912],"tags":[2302,2863,2284,2504],"industry":[],"class_list":["post-512730","expert-view","type-expert-view","status-publish","has-post-thumbnail","hentry","category-google-cloud-me","tag-data-me","tag-data-analytics-me","tag-google-cloud-me","tag-google-cloud-platform-me"],"acf":[],"cards":"\n\t<div class=\"single-post-card\">\n\n\t\t<figure class=\"wp-block-post-featured-image\"><a href=\"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/\" target=\"_self\" ><img width=\"2560\" height=\"1709\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend\" style=\"aspect-ratio:4\/3;width:100%;object-fit:cover;\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg 2560w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-300x200.jpg 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-1024x684.jpg 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-768x513.jpg 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-1536x1025.jpg 1536w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-2048x1367.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/a><\/figure>\n\n\t\t\n\t\t<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-43282307 wp-block-group-is-layout-flex\">\n\t<p style=\"font-style:normal;font-weight:700\" class=\"has-link-color wp-elements-1 wp-block-lp-post-type has-text-color has-primary-color has-small-font-size\">Expert View<\/p>\n\n\t\t\n\t\t<h3 style=\"font-style:normal;font-weight:400\" class=\"wp-block-post-title has-base-font-size\"><a href=\"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/\" target=\"_self\" >A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend<\/a><\/h3><\/div>\n\t\t\n\t<\/div>\n\n","yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend | Devoteam<\/title>\n<meta name=\"description\" content=\"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend\" \/>\n<meta property=\"og:description\" content=\"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/\" \/>\n<meta property=\"og:site_name\" content=\"Devoteam\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-10T13:44:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1709\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/\",\"url\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/\",\"name\":\"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend | Devoteam\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg\",\"datePublished\":\"2022-03-07T09:36:37+00:00\",\"dateModified\":\"2025-04-10T13:44:21+00:00\",\"description\":\"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/#breadcrumb\"},\"inLanguage\":\"en-SA\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-SA\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/#primaryimage\",\"url\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg\",\"width\":2560,\"height\":1709},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/devoteam.info\\\/me\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expert View\",\"item\":\"https:\\\/\\\/devoteam.info\\\/me\\\/expert-view\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/me\\\/#website\",\"url\":\"https:\\\/\\\/devoteam.info\\\/me\\\/\",\"name\":\"Devoteam\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/devoteam.info\\\/me\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-SA\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend | Devoteam","description":"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/","og_locale":"en_US","og_type":"article","og_title":"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend","og_description":"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.","og_url":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/","og_site_name":"Devoteam","article_modified_time":"2025-04-10T13:44:21+00:00","og_image":[{"width":2560,"height":1709,"url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/","url":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/","name":"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend | Devoteam","isPartOf":{"@id":"https:\/\/devoteam.info\/me\/#website"},"primaryImageOfPage":{"@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/#primaryimage"},"image":{"@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/#primaryimage"},"thumbnailUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg","datePublished":"2022-03-07T09:36:37+00:00","dateModified":"2025-04-10T13:44:21+00:00","description":"In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.","breadcrumb":{"@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/#breadcrumb"},"inLanguage":"en-SA","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/"]}]},{"@type":"ImageObject","inLanguage":"en-SA","@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/#primaryimage","url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg","contentUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg","width":2560,"height":1709},{"@type":"BreadcrumbList","@id":"https:\/\/devoteam.info\/me\/expert-view\/a-step-by-step-guide-to-set-up-a-gcp-project-to-start-using-terraform\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devoteam.info\/me\/"},{"@type":"ListItem","position":2,"name":"Expert View","item":"https:\/\/devoteam.info\/me\/expert-view\/"},{"@type":"ListItem","position":3,"name":"A step by step guide to set up a Terraform to work with a GCP project using Cloud Storage as a backend"}]},{"@type":"WebSite","@id":"https:\/\/devoteam.info\/me\/#website","url":"https:\/\/devoteam.info\/me\/","name":"Devoteam","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devoteam.info\/me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-SA"}]}},"uagb_featured_image_src":{"full":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1.jpg",2560,1709,false],"thumbnail":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-150x150.jpg",150,150,true],"medium":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-768x513.jpg",768,513,true],"large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-1024x684.jpg",1024,684,true],"1536x1536":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-1536x1025.jpg",1536,1025,true],"2048x2048":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/introspective-programmer-examining-code-2021-09-24-04-02-44-utc-scaled-1-2048x1367.jpg",2048,1367,true]},"uagb_author_info":{"display_name":"Julien Pawlowski","author_link":"https:\/\/devoteam.info\/me\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"What will you learn?&nbsp; In this guide our data engineer Edgar Ochoa will help you to set up a Terraform to work with a GCP Project using Cloud Storage as a backend.&nbsp; What do you need before starting?&nbsp; To follow this guide you must be familiar with the G Cloud Console and have some basic&hellip;","_links":{"self":[{"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/expert-view\/512730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/expert-view"}],"about":[{"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/types\/expert-view"}],"version-history":[{"count":0,"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/expert-view\/512730\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/media\/287515"}],"wp:attachment":[{"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/media?parent=512730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/categories?post=512730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/tags?post=512730"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/devoteam.info\/me\/wp-json\/wp\/v2\/industry?post=512730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}