tfe_oauth_client

An OAuth Client represents the connection between an organization and a VCS provider.

Example Usage

Basic usage:

resource "tfe_oauth_client" "test" {
  name             = "my-github-oauth-client"
  organization     = "my-org-name"
  api_url          = "https://api.github.com"
  http_url         = "https://github.com"
  oauth_token      = "my-vcs-provider-token"
  service_provider = "github"
  organization_scoped = true
}

Azure DevOps Server Usage

See documentation for HCP Terraform and Terraform Enterprise setup.

Note: This resource requires a private key when creating Azure DevOps Server OAuth clients.

resource "tfe_oauth_client" "test" {
  name             = "my-ado-oauth-client"
  organization     = "my-org-name"
  api_url          = "https://ado.example.com"
  http_url         = "https://ado.example.com"
  oauth_token      = "my-vcs-provider-token"
  private_key      = "-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----"
  service_provider = "ado_server"
}

BitBucket Server Usage

See documentation for HCP Terraform and Terraform Enterprise setup.

When using BitBucket Server, you must use three required fields: key, secret, rsa_public_key.

resource "tfe_oauth_client" "test" {
  name             = "my-bbs-oauth-client"
  organization     = "my-org-name"
  api_url          = "https://bbs.example.com"
  http_url         = "https://bss.example.com"
  key              = "<consumer key>"
  secret           = "-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----"
  rsa_public_key   = "-----BEGIN PUBLIC KEY-----\ncontent\n-----END PUBLIC KEY-----"
  service_provider = "bitbucket_server"
}

Argument Reference

The following arguments are supported:

Attributes Reference