Skip to content

GeKasap/terraform-google-bigquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform - BigQuery datasets

This project is an implementation of Terraform BigQuery Datasets

Layout

main.tf            --> The main terraform files, this includes the module listed below
backend.tf         --> Contains the backend configuration, which is a bucket in Google Storage
vars.tf            --> Variable definition
terraform.tfvars   --> Example how to set variables
modules/
    dataset/  
        --> This module creates a set of datasets in BigQuery by using default
            access permissions, or user defined access

Credential required

Before you begin, you need to define credentials for the communication with GCP

export GOOGLE_APPLICATION_CREDENTIALS=/home/user/my_service_account.json

For more info, check: https://cloud.google.com/community/tutorials/managing-gcp-projects-with-terraform

Variables

Variable name Type Description Default value
project String The ID of the project the resource belongs
region String Region
datasets List A list of datasets to be created
dataset_access List A list of access maps e.g.
{
   role = "OWNER"
   user_by_email = "[email protected]"
},
{
  role = "READER"
  domain = "fofofo.com"
}

Building

Initalization

$ terraform init

Planning

Terraform allows you to "Plan", which allows you to see what it would change without actually making any changes.

$ terraform plan 

Applying

$ terraform apply

Modifying

If you want to delete one or more datasets, then edit the terraform.tfvars file and run again terraform apply

$ terraform apply

Destroying

$ terraform destroy

Author

Georgios Kasapoglou

https://github.com/GeKasap

License

Copyright 2019 Georgios Kasapoglou

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Set up a dataset in BigQuery and access policies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages