Movatterモバイル変換


[0]ホーム

URL:


provider

package
v2.5.3Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2025 License:MPL-2.0Imports:24Imported by:6

Details

Repository

github.com/coder/terraform-provider-coder

Links

Documentation

Index

Constants

View Source
const (ValidationMonotonicIncreasing = "increasing"ValidationMonotonicDecreasing = "decreasing")

Variables

View Source
var ScriptCRONParser = cron.NewParser(cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.DowOptional | cron.Descriptor)

Functions

funcExternalAuthAccessTokenEnvironmentVariable

func ExternalAuthAccessTokenEnvironmentVariable(idstring)string

funcIsPrebuildClaimEnvironmentVariableadded inv2.4.1

func IsPrebuildClaimEnvironmentVariable()string

IsPrebuildClaimEnvironmentVariable returns the name of the environment variable thatindicates whether the workspace is a prebuilt workspace which has just been claimed, and this is the first Terraformapply after that occurrence.

Knowing whether the workspace is a claimed prebuilt workspace allows templateauthors to conditionally execute code in the template based on whether the workspacehas been assigned to a user or not. This allows identity specific configuration tobe applied only after the workspace is claimed, while the rest of the workspace canbe pre-configured.

The value of this environment variable should be set to "true" if the workspace is prebuiltand it has just been claimed by a user. Any other values, including "false"and "" will be interpreted to mean that the workspace is not prebuilt, or wasprebuilt but has not been claimed by a user.

funcIsPrebuildEnvironmentVariableadded inv2.4.0

func IsPrebuildEnvironmentVariable()string

IsPrebuildEnvironmentVariable returns the name of the environment variable thatindicates whether the workspace is an unclaimed prebuilt workspace.

Knowing whether the workspace is an unclaimed prebuilt workspace allows templateauthors to conditionally execute code in the template based on whether the workspacehas been assigned to a user or not. This allows identity specific configuration tobe applied only after the workspace is claimed, while the rest of the workspace canbe pre-configured.

The value of this environment variable should be set to "true" if the workspace is prebuiltand it has not yet been claimed by a user. Any other values, including "false"and "" will be interpreted to mean that the workspace is not prebuilt, or wasprebuilt but has since been claimed by a user.

funcNew

func New() *schema.Provider

New returns a new Terraform provider.

funcParameterEnvironmentVariable

func ParameterEnvironmentVariable(namestring)string

ParameterEnvironmentVariable returns the environment variable to specify fora parameter by it's name. It's hashed because spaces and special characterscan be used in parameter names that may not be valid in env vars.

funcParameterEnvironmentVariablePreviousadded inv2.4.0

func ParameterEnvironmentVariablePrevious(namestring)string

ParameterEnvironmentVariablePrevious returns the environment variable tospecify for a parameter's previous value. This is used for workspacesubsequent builds after the first. Primarily to validate monotonicity in the`validation` block.

funcRunningAgentTokenEnvironmentVariableadded inv2.4.0

func RunningAgentTokenEnvironmentVariable(agentIDstring)string

RunningAgentTokenEnvironmentVariable returns the name of an environment variablethat contains the token to use for the running agent. This is used for prebuilds,where we want to reuse the same token for the next iteration of a workspace agentbefore and after the workspace was claimed by a user.

By reusing an existing token, we can avoid the need to change a value that may have beenused immutably. Thus, allowing us to avoid reprovisioning resources that may take a long timeto replace.

agentID is unused for now, but will be used as soon as we support multiple agents.

funcValidateFormTypeadded inv2.4.0

func ValidateFormType(paramTypeOptionType, optionCountint, specifiedFormTypeParameterFormType) (OptionType,ParameterFormType,error)

ValidateFormType handles the truth table for the valid set of `type` and`form_type` options.The OptionType is also returned because it is possible the 'type' of the'value' & 'default' fields is different from the 'type' of the options.The use case is when using multi-select. The options are 'string' and thevalue is 'list(string)'.

Types

typeExpirationPolicyadded inv2.5.0

type ExpirationPolicy struct {TTLint `mapstructure:"ttl"`}

typeOption

type Option struct {NamestringDescriptionstringValuestringIconstring}

typeOptionTypeadded inv2.4.0

type OptionType =string

OptionType is a type of option that can be used in the 'type' argument ofa parameter. These should match types as defined in terraform:

https://developer.hashicorp.com/terraform/language/expressions/types

The value have to be string literals, as type constraint keywords are notsupported in providers.

const (OptionTypeStringOptionType = "string"OptionTypeNumberOptionType = "number"OptionTypeBooleanOptionType = "bool"OptionTypeListStringOptionType = "list(string)")

funcOptionTypesadded inv2.4.0

func OptionTypes() []OptionType

typeParameter

type Parameter struct {NamestringDisplayNamestring `mapstructure:"display_name"`DescriptionstringTypeOptionTypeFormTypeParameterFormType `mapstructure:"form_type"`MutableboolDefault     *stringIconstringOption      []OptionValidation  []ValidationOptionalboolOrderintEphemeralbool}

func (*Parameter)ValidOptionsadded inv2.4.0

func (v *Parameter) ValidOptions(optionTypeOptionType) (map[string]struct{},diag.Diagnostics)

func (*Parameter)ValidateInputadded inv2.4.0

func (v *Parameter) ValidateInput(input *string, previous *string) (string,diag.Diagnostics)

typeParameterFormTypeadded inv2.4.0

type ParameterFormTypestring

ParameterFormType is the list of supported form types for display inthe Coder "create workspace" form. These form types are functional as wellas cosmetic. Refer to `formTypeTruthTable` for the allowed pairings.For example, "multi-select" has the type "list(string)" but the optionvalues are "string".

const (ParameterFormTypeDefaultParameterFormType = ""ParameterFormTypeRadioParameterFormType = "radio"ParameterFormTypeSliderParameterFormType = "slider"ParameterFormTypeInputParameterFormType = "input"ParameterFormTypeDropdownParameterFormType = "dropdown"ParameterFormTypeCheckboxParameterFormType = "checkbox"ParameterFormTypeSwitchParameterFormType = "switch"ParameterFormTypeMultiSelectParameterFormType = "multi-select"ParameterFormTypeTagSelectParameterFormType = "tag-select"ParameterFormTypeTextAreaParameterFormType = "textarea"ParameterFormTypeErrorParameterFormType = "error")

funcParameterFormTypesadded inv2.4.0

func ParameterFormTypes() []ParameterFormType

ParameterFormTypes should be kept in sync with the enum list above.

typeValidation

type Validation struct {MinintMinDisabledbool `mapstructure:"min_disabled"`MaxintMaxDisabledbool `mapstructure:"max_disabled"`MonotonicstringRegexstringErrorstring}

func (*Validation)Valid

func (v *Validation) Valid(typOptionType, valuestring, previous *string)error

typeWorkspacePrebuildadded inv2.4.0

type WorkspacePrebuild struct {Instancesint `mapstructure:"instances"`// There should always be only one expiration_policy block, but Terraform's type system// still parses them as a slice, so we need to handle it as such. We could use// an anonymous type and rd.Get to avoid a slice here, but that would not be possible// for utilities that parse our terraform output using this type. To remain compatible// with those cases, we use a slice here.ExpirationPolicy []ExpirationPolicy `mapstructure:"expiration_policy"`}

typeWorkspacePresetadded inv2.1.3

type WorkspacePreset struct {Namestring            `mapstructure:"name"`Parameters map[string]string `mapstructure:"parameters"`// There should always be only one prebuild block, but Terraform's type system// still parses them as a slice, so we need to handle it as such. We could use// an anonymous type and rd.Get to avoid a slice here, but that would not be possible// for utilities that parse our terraform output using this type. To remain compatible// with those cases, we use a slice here.Prebuilds []WorkspacePrebuild `mapstructure:"prebuilds"`}

typeWorkspaceTags

type WorkspaceTags struct {Tags map[string]string}

Source Files

View all Source files

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp