coder 2.13.1 published on Wednesday, Nov 5, 2025 by coder
coder.getExternalAuth
Start a Neo task
Explain and create a coder.getExternalAuth resource
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services in a workspace. (e.g. Google Cloud, Github, Docker, etc.)
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as coder from "@pulumi/coder";
const github = coder.getExternalAuth({
id: "github",
});
const azure_identity = coder.getExternalAuth({
id: "azure-identiy",
optional: true,
});
import pulumi
import pulumi_coder as coder
github = coder.get_external_auth(id="github")
azure_identity = coder.get_external_auth(id="azure-identiy",
optional=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/coder/v2/coder"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := coder.GetExternalAuth(ctx, &coder.GetExternalAuthArgs{
Id: "github",
}, nil)
if err != nil {
return err
}
_, err = coder.GetExternalAuth(ctx, &coder.GetExternalAuthArgs{
Id: "azure-identiy",
Optional: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Coder = Pulumi.Coder;
return await Deployment.RunAsync(() =>
{
var github = Coder.GetExternalAuth.Invoke(new()
{
Id = "github",
});
var azure_identity = Coder.GetExternalAuth.Invoke(new()
{
Id = "azure-identiy",
Optional = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.coder.CoderFunctions;
import com.pulumi.coder.inputs.GetExternalAuthArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var github = CoderFunctions.getExternalAuth(GetExternalAuthArgs.builder()
.id("github")
.build());
final var azure-identity = CoderFunctions.getExternalAuth(GetExternalAuthArgs.builder()
.id("azure-identiy")
.optional(true)
.build());
}
}
variables:
github:
fn::invoke:
function: coder:getExternalAuth
arguments:
id: github
azure-identity:
fn::invoke:
function: coder:getExternalAuth
arguments:
id: azure-identiy
optional: true
Using getExternalAuth
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getExternalAuth(args: GetExternalAuthArgs, opts?: InvokeOptions): Promise<GetExternalAuthResult>
function getExternalAuthOutput(args: GetExternalAuthOutputArgs, opts?: InvokeOptions): Output<GetExternalAuthResult>def get_external_auth(id: Optional[str] = None,
optional: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetExternalAuthResult
def get_external_auth_output(id: Optional[pulumi.Input[str]] = None,
optional: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetExternalAuthResult]func GetExternalAuth(ctx *Context, args *GetExternalAuthArgs, opts ...InvokeOption) (*GetExternalAuthResult, error)
func GetExternalAuthOutput(ctx *Context, args *GetExternalAuthOutputArgs, opts ...InvokeOption) GetExternalAuthResultOutput> Note: This function is named GetExternalAuth in the Go SDK.
public static class GetExternalAuth
{
public static Task<GetExternalAuthResult> InvokeAsync(GetExternalAuthArgs args, InvokeOptions? opts = null)
public static Output<GetExternalAuthResult> Invoke(GetExternalAuthInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetExternalAuthResult> getExternalAuth(GetExternalAuthArgs args, InvokeOptions options)
public static Output<GetExternalAuthResult> getExternalAuth(GetExternalAuthArgs args, InvokeOptions options)
fn::invoke:
function: coder:index/getExternalAuth:getExternalAuth
arguments:
# arguments dictionaryThe following arguments are supported:
getExternalAuth Result
The following output properties are available:
- Access
Token string - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- Id string
- The ID of a configured external auth provider set up in your Coder deployment.
- Optional bool
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
- Access
Token string - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- Id string
- The ID of a configured external auth provider set up in your Coder deployment.
- Optional bool
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
- access
Token String - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- id String
- The ID of a configured external auth provider set up in your Coder deployment.
- optional Boolean
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
- access
Token string - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- id string
- The ID of a configured external auth provider set up in your Coder deployment.
- optional boolean
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
- access_
token str - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- id str
- The ID of a configured external auth provider set up in your Coder deployment.
- optional bool
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
- access
Token String - The access token returned by the external auth provider. This can be used to pre-authenticate command-line tools.
- id String
- The ID of a configured external auth provider set up in your Coder deployment.
- optional Boolean
- Authenticating with the external auth provider is not required, and can be skipped by users when creating or updating workspaces
Package Details
- Repository
- coder coder/terraform-provider-coder
- License
- Notes
- This Pulumi package is based on the
coderTerraform Provider.
