Skip to content

Make external auth providers optional #10109

@bpmct

Description

@bpmct

Background

We have a coder_external_auth data source that requires the user auth with git or another sevice before creating the template.

Current behavior

When git auth is added to a template, it is currently required. However, some organizations are migrating from one git provider to another or rolling out a provider to others. This means not all template users have an account on a given service. Terraform is also capable of conditional logic, such as cloning a repo if the user authed

Proposed behavior

A provider can be marked as optional.

data "coder_external_auth" "experimental_github" {
  id = "experimental_github"
  required = false # default is true to avoid a breaking change
}

resource "coder_agent" "my script" {
  # ...
  startup_script=<<EOF
  # this is pseudocode 
  if [${data.coder_parameter.external_auth.token == !null}] then;
    git clone ...
  fi
  EOF
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions