This Terraform plan will help you to create a Google Cloud Storage bucket and use it as backend file to store your Terraform state file. There is also a backend.tf.sample file to configure the remote backend.
Steps for running Terraform plan
- Create a service account with sufficient permissions.
 - Please make sure that have the required Cloud Storage permissions for your account:
 
- storage.buckets.create
 - storage.buckets.list
 - storage.objects.get
 - storage.objects.create
 - storage.objects.delete
 - storage.objects.update
 
- Download the JSON key file of the service account to your local computer.
 - Adjust the path " "path/to/your/service-account-key.json"" of the JSON key file in the variable "gcp_service_credentials".
 - Set the name of your Google Cloud project in the variable "gcp_project_id.
 - Run the main.tf script 
terraform applyto create a Cloud Storage bucket with the correct settings. - Rename the backend.tf.sample to backend.tf and store it in the root of your Terraform repository.
 - Edit the backend.tf and add the name of the create Cloud Storage bucket.
 - Run 
terraform initto configure the Terraform backend. - Use the command 
terraform showto see if the backend is configured correctly, you should now see the output of the most recent state file. 
If you already have a local state file, Terraform will detect it and prompt you to copy it to the create Cloud Storage bucket.
VAMOS, happy coding! 😃