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. |
~> 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.
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
}
id
(String) The identifier of a configured git auth provider set up in your Coder deployment.
access_token
(String) The access token returned by the git authentication provider. This can be used to pre-authenticate command-line tools.