Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.42 KB

File metadata and controls

52 lines (40 loc) · 1.42 KB
page_title subcategory description
coder_git_auth Data Source - terraform-provider-coder
~> Deprecated Use the coder_external_auth data source instead. Use this data source to require users to authenticate with a Git provider prior to workspace creation. This can be used to perform an authenticated git clone in startup scripts.

coder_git_auth (Data Source)

~> Deprecated Use the coder_external_auth data source instead.

Use this data source to require users to authenticate with a Git provider prior to workspace creation. This can be used to perform an authenticated git clone in startup scripts.

Example Usage

provider "coder" {}

data "coder_git_auth" "github" {
  # Matches the ID of the git auth provider in Coder.
  id = "github"
}

resource "coder_agent" "dev" {
  os   = "linux"
  arch = "amd64"
  dir  = "~/coder"
  env = {
    GITHUB_TOKEN : data.coder_git_auth.github.access_token
  }
  startup_script = <<EOF
if [ ! -d ~/coder ]; then
    git clone https://github.com/coder/coder
fi
EOF
}

Schema

Required

  • id (String) The identifier of a configured git auth provider set up in your Coder deployment.

Read-Only

  • access_token (String) The access token returned by the git authentication provider. This can be used to pre-authenticate command-line tools.