Skip to content

Stable way to get Workspace owner's email in terraform #326

Open
@aarosil

Description

@aarosil

I'm reading data.coder_workspace_owner.me.email in a template for use in Kubernetes, to derive the user's namespace from their email address. During destroy, the datasource returns [email protected], so my template breaks. Is there a stable way to access the user's email from within the template?

This is the code I'm using now which doesn't work:

namespace = data.coder_workspace_owner.me.email != "[email protected]" ? replace(split("@", data.coder_workspace_owner.me.email)[0], ".", "-") : "coder"

I added a check for the default value after noticing template push failed validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions