Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Latest commit

 

History

History
48 lines (34 loc) · 1.53 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.53 KB

Terraform Provider for Site24x7

This is a custom provider for Site24x7 API

example.tf file with the provider section:

provider "site24x7" {
  oauth_client_id = "your client id"
  oauth_client_secret = "your client secret"
  oauth_refresh_token = "your refresh token"
}

You can choose to specify the OAuth2 values as environment variables instead of including them in the provider section:

  • SITE24X7_CLIENT_ID
  • SITE24X7_CLIENT_SECRET
  • SITE24X7_REFRESH_TOKEN

Installation

$ brew install terraform
$ go get -u github.com/sourcegraph/terraform-provider-site24x7 && cp $GOPATH/bin/terraform-provider-site24x7 .
$ echo 'providers { site24x7 = "terraform-provider-site24x7" }' >> ~/.terraformrc

Obtaining new OAuth2 credentials

NOTE: This is only needed if the current credentials do not work (because scope changed for example). The current scope is Site24x7.Admin.All.

If for some reason the OAuth2 credentials stored in example.tf don't work anymore or scope needs to change do the following:

Follow these instructions to obtain a client id, client secret and generate code token.

Feed those into the script below:

$ cd site24x7/oauth/cmd/site24x7-oauth
$ go run site24x7-oauth -clientId <someid> -clientSecret <somesecret> -generateCode <sometoken>

It will print to stdout the contents to be stored in example.tf.