terraform-provider-googleappscript

command module
v0.0.0-...-d54c562 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 3 Imported by: 0

README

Terraform Google AppScript Provider

This is a Terraform provider for managing Google appscript projects.

Installation

  1. Download the latest compiled binary from GitHub releases.

  2. Unzip/untar the archive.

  3. Move it into $HOME/.terraform.d/plugins:

    $ mkdir -p $HOME/.terraform.d/plugins/linux_amd64
    $ mv terraform-provider-googleappscript $HOME/.terraform.d/plugins/terraform-provider-googleappscript_v0.1.0
    
  4. Create your Terraform configurations as normal, and run terraform init:

    $ terraform init
    

    This will find the plugin locally.

Usage

  1. Since google appscript api does not support service account authentication, you will need a OAuth token file to run provider and unfortunately you will have to renew your token file whenever its expired.

    1. Go to APIs & Services of Google Cloud Platform
    2. Create a credential and download as a file
    3. Run this script with credentials file
    4. Copy-paste url to your browser
    5. Give permissions and copy back code to terminal
    6. Your token file should be created.
  2. Create a Terraform configuration file:

       provider "googleappscript" {
         token_file = "token.json"
       }
    
       resource "googleappscript_project" "example" {
         title = "terraform-example"
    
         script {
           name = "appsscript"
           type = "JSON"
           source = "{\"timeZone\":\"America/New_York\",\"exceptionLogging\":\"CLOUD\"}"
         }
    
         script {
           name = "hello"
           type = "SERVER_JS"
           source = "function helloWorld() {\n  console.log('goodbye, world!');}"
         }
    
       }
    
  3. Run terraform init to pull in the provider:

    $ terraform init
    
  4. Run terraform plan and terraform apply to create events:

    $ terraform plan
    
    $ terraform apply
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL