provider

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MPL-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LastVersionsKey = "last_versions"
View Source
var UUIDType = uuidType{}

Functions

func CheckGroupEntitlements

func CheckGroupEntitlements(ctx context.Context, features map[codersdk.FeatureName]codersdk.Feature) (diags diag.Diagnostics)

func New

func New(version string) func() provider.Provider

func NewAIProviderResource added in v0.0.20

func NewAIProviderResource() resource.Resource

func NewAgentsDefaultModelResource added in v0.0.24

func NewAgentsDefaultModelResource() resource.Resource

func NewAgentsMCPServerResource added in v0.0.24

func NewAgentsMCPServerResource() resource.Resource

func NewAgentsModelResource added in v0.0.20

func NewAgentsModelResource() resource.Resource

func NewAgentsSystemPromptResource added in v0.0.24

func NewAgentsSystemPromptResource() resource.Resource

func NewGroupDataSource

func NewGroupDataSource() datasource.DataSource

func NewGroupResource

func NewGroupResource() resource.Resource

func NewLicenseResource added in v0.0.5

func NewLicenseResource() resource.Resource

func NewOAuth2ProviderSettingsResource added in v0.0.23

func NewOAuth2ProviderSettingsResource() resource.Resource

func NewOrganizationDataSource

func NewOrganizationDataSource() datasource.DataSource

func NewOrganizationGroupSyncResource added in v0.0.12

func NewOrganizationGroupSyncResource() resource.Resource

func NewOrganizationResource added in v0.0.8

func NewOrganizationResource() resource.Resource

func NewOrganizationSyncSettingsResource added in v0.0.10

func NewOrganizationSyncSettingsResource() resource.Resource

func NewProvisionerKeyResource added in v0.0.8

func NewProvisionerKeyResource() resource.Resource

func NewTemplateDataSource

func NewTemplateDataSource() datasource.DataSource

func NewTemplateResource

func NewTemplateResource() resource.Resource

func NewUserDataSource

func NewUserDataSource() datasource.DataSource

func NewUserResource

func NewUserResource() resource.Resource

func NewVersionsPlanModifier

func NewVersionsPlanModifier() planmodifier.List

func NewVersionsValidator added in v0.0.9

func NewVersionsValidator() validator.List

func NewWorkspaceProxyResource

func NewWorkspaceProxyResource() resource.Resource

func PrintOrNull

func PrintOrNull(v any) string

Types

type ACL

type ACL struct {
	UserPermissions  []Permission `tfsdk:"users"`
	GroupPermissions []Permission `tfsdk:"groups"`
}

type AIProviderBedrockSettingsModel added in v0.0.20

type AIProviderBedrockSettingsModel struct {
	Region               types.String `tfsdk:"region"`
	Model                types.String `tfsdk:"model"`
	SmallFastModel       types.String `tfsdk:"small_fast_model"`
	RoleARN              types.String `tfsdk:"role_arn"`
	ExternalID           types.String `tfsdk:"external_id"`
	AccessKeyWO          types.String `tfsdk:"access_key_wo"`
	AccessKeySecretWO    types.String `tfsdk:"access_key_secret_wo"`
	CredentialsWOVersion types.Int64  `tfsdk:"credentials_wo_version"`
	Protocol             types.String `tfsdk:"protocol"`
}

type AIProviderResource added in v0.0.20

type AIProviderResource struct {
	// contains filtered or unexported fields
}

func (*AIProviderResource) Configure added in v0.0.20

func (*AIProviderResource) Create added in v0.0.20

func (*AIProviderResource) Delete added in v0.0.20

func (*AIProviderResource) ImportState added in v0.0.20

func (*AIProviderResource) Metadata added in v0.0.20

func (*AIProviderResource) ModifyPlan added in v0.0.20

func (*AIProviderResource) Read added in v0.0.20

func (*AIProviderResource) Schema added in v0.0.20

func (*AIProviderResource) Update added in v0.0.20

func (*AIProviderResource) ValidateConfig added in v0.0.20

type AIProviderResourceModel added in v0.0.20

type AIProviderResourceModel struct {
	ID              UUID                     `tfsdk:"id"`
	Type            types.String             `tfsdk:"type"`
	Name            types.String             `tfsdk:"name"`
	DisplayName     types.String             `tfsdk:"display_name"`
	Enabled         types.Bool               `tfsdk:"enabled"`
	BaseURL         types.String             `tfsdk:"base_url"`
	APIKeyWO        types.String             `tfsdk:"api_key_wo"`
	APIKeyWOVersion types.Int64              `tfsdk:"api_key_wo_version"`
	APIKeyMasked    types.String             `tfsdk:"api_key_masked"`
	Settings        *AIProviderSettingsModel `tfsdk:"settings"`
	CreatedAt       types.Int64              `tfsdk:"created_at"`
	UpdatedAt       types.Int64              `tfsdk:"updated_at"`
}

type AIProviderSettingsModel added in v0.0.20

type AIProviderSettingsModel struct {
	Bedrock *AIProviderBedrockSettingsModel `tfsdk:"bedrock"`
}

type AgentsDefaultModelResource added in v0.0.24

type AgentsDefaultModelResource struct {
	// contains filtered or unexported fields
}

func (*AgentsDefaultModelResource) Configure added in v0.0.24

func (*AgentsDefaultModelResource) Create added in v0.0.24

func (*AgentsDefaultModelResource) Delete added in v0.0.24

func (*AgentsDefaultModelResource) ImportState added in v0.0.24

func (*AgentsDefaultModelResource) Metadata added in v0.0.24

func (*AgentsDefaultModelResource) ModifyPlan added in v0.0.24

func (*AgentsDefaultModelResource) MoveState added in v0.0.24

func (*AgentsDefaultModelResource) Read added in v0.0.24

func (*AgentsDefaultModelResource) Schema added in v0.0.24

func (*AgentsDefaultModelResource) Update added in v0.0.24

type AgentsDefaultModelResourceModel added in v0.0.24

type AgentsDefaultModelResourceModel struct {
	ID             UUID `tfsdk:"id"`
	OrganizationID UUID `tfsdk:"organization_id"`
	ModelID        UUID `tfsdk:"model_id"`
}

type AgentsMCPServerResource added in v0.0.24

type AgentsMCPServerResource struct {
	// contains filtered or unexported fields
}

func (*AgentsMCPServerResource) Configure added in v0.0.24

func (*AgentsMCPServerResource) Create added in v0.0.24

func (*AgentsMCPServerResource) Delete added in v0.0.24

func (*AgentsMCPServerResource) ImportState added in v0.0.24

func (*AgentsMCPServerResource) Metadata added in v0.0.24

func (*AgentsMCPServerResource) ModifyPlan added in v0.0.24

func (*AgentsMCPServerResource) Read added in v0.0.24

func (*AgentsMCPServerResource) Schema added in v0.0.24

func (*AgentsMCPServerResource) Update added in v0.0.24

func (*AgentsMCPServerResource) ValidateConfig added in v0.0.24

type AgentsMCPServerResourceModel added in v0.0.24

type AgentsMCPServerResourceModel struct {
	ID                          UUID         `tfsdk:"id"`
	OrganizationID              UUID         `tfsdk:"organization_id"`
	DisplayName                 types.String `tfsdk:"display_name"`
	Slug                        types.String `tfsdk:"slug"`
	URL                         types.String `tfsdk:"url"`
	Description                 types.String `tfsdk:"description"`
	IconURL                     types.String `tfsdk:"icon_url"`
	Transport                   types.String `tfsdk:"transport"`
	AuthType                    types.String `tfsdk:"auth_type"`
	Availability                types.String `tfsdk:"availability"`
	OAuth2ClientID              types.String `tfsdk:"oauth2_client_id"`
	OAuth2ClientSecretWO        types.String `tfsdk:"oauth2_client_secret_wo"`
	OAuth2ClientSecretWOVersion types.Int64  `tfsdk:"oauth2_client_secret_wo_version"`
	OAuth2AuthURL               types.String `tfsdk:"oauth2_auth_url"`
	OAuth2TokenURL              types.String `tfsdk:"oauth2_token_url"`
	OAuth2RevocationURL         types.String `tfsdk:"oauth2_revocation_url"`
	OAuth2Scopes                types.String `tfsdk:"oauth2_scopes"`
	APIKeyHeader                types.String `tfsdk:"api_key_header"`
	APIKeyValueWO               types.String `tfsdk:"api_key_value_wo"`
	APIKeyValueWOVersion        types.Int64  `tfsdk:"api_key_value_wo_version"`
	CustomHeadersWO             types.Map    `tfsdk:"custom_headers_wo"`
	CustomHeadersWOVersion      types.Int64  `tfsdk:"custom_headers_wo_version"`
	ToolAllowList               types.Set    `tfsdk:"tool_allow_list"`
	ToolDenyList                types.Set    `tfsdk:"tool_deny_list"`
	Enabled                     types.Bool   `tfsdk:"enabled"`
	ModelIntent                 types.Bool   `tfsdk:"model_intent"`
	AllowInPlanMode             types.Bool   `tfsdk:"allow_in_plan_mode"`
	ForwardCoderHeaders         types.Bool   `tfsdk:"forward_coder_headers"`
	CreatedAt                   types.Int64  `tfsdk:"created_at"`
	UpdatedAt                   types.Int64  `tfsdk:"updated_at"`
}

type AgentsModelResource added in v0.0.20

type AgentsModelResource struct {
	// contains filtered or unexported fields
}

func (*AgentsModelResource) Configure added in v0.0.20

func (*AgentsModelResource) Create added in v0.0.20

func (*AgentsModelResource) Delete added in v0.0.20

func (*AgentsModelResource) ImportState added in v0.0.20

func (*AgentsModelResource) Metadata added in v0.0.20

func (*AgentsModelResource) ModifyPlan added in v0.0.20

func (*AgentsModelResource) Read added in v0.0.20

func (*AgentsModelResource) Schema added in v0.0.20

func (*AgentsModelResource) Update added in v0.0.20

type AgentsModelResourceModel added in v0.0.20

type AgentsModelResourceModel struct {
	ID                   UUID                   `tfsdk:"id"`
	OrganizationID       UUID                   `tfsdk:"organization_id"`
	AIProviderID         UUID                   `tfsdk:"ai_provider_id"`
	ProviderType         types.String           `tfsdk:"provider_type"`
	Model                types.String           `tfsdk:"model"`
	DisplayName          types.String           `tfsdk:"display_name"`
	Enabled              types.Bool             `tfsdk:"enabled"`
	ContextLimit         types.Int64            `tfsdk:"context_limit"`
	CompressionThreshold types.Int64            `tfsdk:"compression_threshold"`
	ModelConfig          agentsModelConfigValue `tfsdk:"model_config"`
	CreatedAt            types.Int64            `tfsdk:"created_at"`
	UpdatedAt            types.Int64            `tfsdk:"updated_at"`
}

type AgentsSystemPromptResource added in v0.0.24

type AgentsSystemPromptResource struct {
	*CoderdProviderData
}

func (*AgentsSystemPromptResource) Configure added in v0.0.24

func (*AgentsSystemPromptResource) Create added in v0.0.24

func (*AgentsSystemPromptResource) Delete added in v0.0.24

func (*AgentsSystemPromptResource) ImportState added in v0.0.24

func (*AgentsSystemPromptResource) Metadata added in v0.0.24

func (*AgentsSystemPromptResource) ModifyPlan added in v0.0.24

func (*AgentsSystemPromptResource) Read added in v0.0.24

func (*AgentsSystemPromptResource) Schema added in v0.0.24

func (*AgentsSystemPromptResource) Update added in v0.0.24

type AgentsSystemPromptResourceModel added in v0.0.24

type AgentsSystemPromptResourceModel struct {
	SystemPrompt               agentsSystemPromptTextValue `tfsdk:"system_prompt"`
	IncludeDefaultSystemPrompt types.Bool                  `tfsdk:"include_default_system_prompt"`
}

type AutostopRequirement

type AutostopRequirement struct {
	DaysOfWeek []string `tfsdk:"days_of_week"`
	Weeks      int64    `tfsdk:"weeks"`
}

type CoderdProvider

type CoderdProvider struct {
	// contains filtered or unexported fields
}

CoderdProvider defines the provider implementation.

func (*CoderdProvider) Configure

func (*CoderdProvider) DataSources

func (p *CoderdProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*CoderdProvider) Functions

func (p *CoderdProvider) Functions(ctx context.Context) []func() function.Function

func (*CoderdProvider) Metadata

func (*CoderdProvider) Resources

func (p *CoderdProvider) Resources(ctx context.Context) []func() resource.Resource

func (*CoderdProvider) Schema

type CoderdProviderData

type CoderdProviderData struct {
	Client                *codersdk.Client
	DefaultOrganizationID uuid.UUID
	// contains filtered or unexported fields
}

func (*CoderdProviderData) FeatureEnabled added in v0.0.14

func (d *CoderdProviderData) FeatureEnabled(name codersdk.FeatureName) bool

FeatureEnabled reports whether the named feature is enabled in the current entitlements snapshot.

func (*CoderdProviderData) Features

Features returns the current feature entitlements snapshot. Callers must not mutate the returned map.

func (*CoderdProviderData) SetFeatures added in v0.0.14

func (d *CoderdProviderData) SetFeatures(in map[codersdk.FeatureName]codersdk.Feature)

SetFeatures atomically replaces the cached feature entitlements. The input map is copied so callers may continue to mutate it safely.

type CoderdProviderModel

type CoderdProviderModel struct {
	URL   types.String `tfsdk:"url"`
	Token types.String `tfsdk:"token"`

	DefaultOrganizationID UUID      `tfsdk:"default_organization_id"`
	Headers               types.Map `tfsdk:"headers"`
}

CoderdProviderModel describes the provider data model.

type GroupDataSource

type GroupDataSource struct {
	// contains filtered or unexported fields
}

GroupDataSource defines the data source implementation.

func (*GroupDataSource) Configure

func (*GroupDataSource) Metadata

func (*GroupDataSource) Read

func (*GroupDataSource) Schema

type GroupDataSourceModel

type GroupDataSourceModel struct {
	// ID or name and organization ID must be set
	ID             UUID         `tfsdk:"id"`
	Name           types.String `tfsdk:"name"`
	OrganizationID UUID         `tfsdk:"organization_id"`

	DisplayName    types.String `tfsdk:"display_name"`
	AvatarURL      types.String `tfsdk:"avatar_url"`
	QuotaAllowance types.Int32  `tfsdk:"quota_allowance"`
	Source         types.String `tfsdk:"source"`
	Members        []Member     `tfsdk:"members"`
}

GroupDataSourceModel describes the data source data model.

type GroupResource

type GroupResource struct {
	// contains filtered or unexported fields
}

GroupResource defines the resource implementation.

func (*GroupResource) Configure

func (*GroupResource) Create

func (*GroupResource) Delete

func (*GroupResource) ImportState

func (*GroupResource) Metadata

func (*GroupResource) Read

func (*GroupResource) Schema

func (*GroupResource) Update

type GroupResourceModel

type GroupResourceModel struct {
	ID UUID `tfsdk:"id"`

	Name           types.String `tfsdk:"name"`
	DisplayName    types.String `tfsdk:"display_name"`
	AvatarURL      types.String `tfsdk:"avatar_url"`
	QuotaAllowance types.Int32  `tfsdk:"quota_allowance"`
	OrganizationID UUID         `tfsdk:"organization_id"`
	Members        types.Set    `tfsdk:"members"`
}

GroupResourceModel describes the resource data model.

type GroupSyncModel added in v0.0.8

type GroupSyncModel struct {
	Field             types.String `tfsdk:"field"`
	RegexFilter       types.String `tfsdk:"regex_filter"`
	AutoCreateMissing types.Bool   `tfsdk:"auto_create_missing"`
	Mapping           types.Map    `tfsdk:"mapping"`
}

func (GroupSyncModel) ValueObject added in v0.0.8

func (m GroupSyncModel) ValueObject() types.Object

type LastVersionsByHash

type LastVersionsByHash = map[string][]PreviousTemplateVersion

type LicenseResource added in v0.0.5

type LicenseResource struct {
	// contains filtered or unexported fields
}

LicenseResource defines the resource implementation.

func (*LicenseResource) Configure added in v0.0.5

func (*LicenseResource) Create added in v0.0.5

func (*LicenseResource) Delete added in v0.0.5

func (*LicenseResource) Metadata added in v0.0.5

func (*LicenseResource) Read added in v0.0.5

func (*LicenseResource) Schema added in v0.0.5

func (*LicenseResource) Update added in v0.0.5

type LicenseResourceModel added in v0.0.5

type LicenseResourceModel struct {
	ID        types.Int32  `tfsdk:"id"`
	ExpiresAt types.Int64  `tfsdk:"expires_at"`
	License   types.String `tfsdk:"license"`
}

LicenseResourceModel describes the resource data model.

type Member

type Member struct {
	ID         UUID         `tfsdk:"id"`
	Username   types.String `tfsdk:"username"`
	Email      types.String `tfsdk:"email"`
	CreatedAt  types.Int64  `tfsdk:"created_at"`
	LastSeenAt types.Int64  `tfsdk:"last_seen_at"`
	Status     types.String `tfsdk:"status"`
	LoginType  types.String `tfsdk:"login_type"`
}

type OAuth2ProviderSettingsResource added in v0.0.23

type OAuth2ProviderSettingsResource struct {
	*CoderdProviderData
}

func (*OAuth2ProviderSettingsResource) Configure added in v0.0.23

func (*OAuth2ProviderSettingsResource) Create added in v0.0.23

func (*OAuth2ProviderSettingsResource) Delete added in v0.0.23

func (*OAuth2ProviderSettingsResource) ImportState added in v0.0.23

func (*OAuth2ProviderSettingsResource) Metadata added in v0.0.23

func (*OAuth2ProviderSettingsResource) ModifyPlan added in v0.0.23

ModifyPlan warns, at plan time, when a first apply is about to disable Dynamic Client Registration on a deployment where it is currently enabled.

That is the one direction worth flagging. A create has no prior state to diff against, so Terraform renders it as a plain "will be created" with no hint that a live value is being discarded. Surfacing it during plan is what gives the admin a chance to `terraform import` instead, while nothing has been changed yet.

Deliberately not symmetric: a live `false` is indistinguishable from "never configured", because the server coalesces both, so warning whenever the live value merely differs from the plan would fire on every greenfield apply (live `false`, config `true`) for no benefit.

func (*OAuth2ProviderSettingsResource) Read added in v0.0.23

func (*OAuth2ProviderSettingsResource) Schema added in v0.0.23

func (*OAuth2ProviderSettingsResource) Update added in v0.0.23

type OAuth2ProviderSettingsResourceModel added in v0.0.23

type OAuth2ProviderSettingsResourceModel struct {
	DynamicClientRegistrationEnabled types.Bool `tfsdk:"dynamic_client_registration_enabled"`
}

OAuth2ProviderSettingsResourceModel describes the resource data model.

type OrganizationDataSource

type OrganizationDataSource struct {
	// contains filtered or unexported fields
}

OrganizationDataSource defines the data source implementation.

func (*OrganizationDataSource) ConfigValidators

func (*OrganizationDataSource) Configure

func (*OrganizationDataSource) Metadata

func (*OrganizationDataSource) Read

func (*OrganizationDataSource) Schema

type OrganizationDataSourceModel

type OrganizationDataSourceModel struct {
	// Exactly one of ID, IsDefault, or Name must be set.
	ID        UUID         `tfsdk:"id"`
	IsDefault types.Bool   `tfsdk:"is_default"`
	Name      types.String `tfsdk:"name"`

	CreatedAt        types.Int64  `tfsdk:"created_at"`
	UpdatedAt        types.Int64  `tfsdk:"updated_at"`
	WorkspaceSharing types.String `tfsdk:"workspace_sharing"`
	// TODO: This could reasonably store some User object - though we may need to make additional queries depending on what fields we
	// want, or to have one consistent user type for all data sources.
	Members types.Set `tfsdk:"members"`
}

OrganizationDataSourceModel describes the data source data model.

type OrganizationGroupSyncResource added in v0.0.12

type OrganizationGroupSyncResource struct {
	*CoderdProviderData
}

func (*OrganizationGroupSyncResource) Configure added in v0.0.12

func (*OrganizationGroupSyncResource) Create added in v0.0.12

func (*OrganizationGroupSyncResource) Delete added in v0.0.12

func (*OrganizationGroupSyncResource) ImportState added in v0.0.12

func (*OrganizationGroupSyncResource) Metadata added in v0.0.12

func (*OrganizationGroupSyncResource) Read added in v0.0.12

func (*OrganizationGroupSyncResource) Schema added in v0.0.12

func (*OrganizationGroupSyncResource) Update added in v0.0.12

type OrganizationGroupSyncResourceModel added in v0.0.12

type OrganizationGroupSyncResourceModel struct {
	OrganizationID    UUID         `tfsdk:"organization_id"`
	Field             types.String `tfsdk:"field"`
	RegexFilter       types.String `tfsdk:"regex_filter"`
	AutoCreateMissing types.Bool   `tfsdk:"auto_create_missing"`
	Mapping           types.Map    `tfsdk:"mapping"`
}

OrganizationGroupSyncResourceModel describes the resource data model.

type OrganizationResource added in v0.0.8

type OrganizationResource struct {
	*CoderdProviderData
}

func (*OrganizationResource) Configure added in v0.0.8

func (*OrganizationResource) Create added in v0.0.8

func (*OrganizationResource) Delete added in v0.0.8

func (*OrganizationResource) ImportState added in v0.0.8

func (*OrganizationResource) Metadata added in v0.0.8

func (*OrganizationResource) Read added in v0.0.8

func (*OrganizationResource) Schema added in v0.0.8

func (*OrganizationResource) Update added in v0.0.8

type OrganizationResourceModel added in v0.0.8

type OrganizationResourceModel struct {
	ID UUID `tfsdk:"id"`

	Name             types.String `tfsdk:"name"`
	DisplayName      types.String `tfsdk:"display_name"`
	Description      types.String `tfsdk:"description"`
	Icon             types.String `tfsdk:"icon"`
	WorkspaceSharing types.String `tfsdk:"workspace_sharing"`

	OrgSyncIdpGroups types.Set    `tfsdk:"org_sync_idp_groups"`
	GroupSync        types.Object `tfsdk:"group_sync"`
	RoleSync         types.Object `tfsdk:"role_sync"`
}

OrganizationResourceModel describes the resource data model.

type OrganizationSyncSettingsResource added in v0.0.10

type OrganizationSyncSettingsResource struct {
	*CoderdProviderData
}

func (*OrganizationSyncSettingsResource) Configure added in v0.0.10

func (*OrganizationSyncSettingsResource) Create added in v0.0.10

func (*OrganizationSyncSettingsResource) Delete added in v0.0.10

func (*OrganizationSyncSettingsResource) Metadata added in v0.0.10

func (*OrganizationSyncSettingsResource) Read added in v0.0.10

func (*OrganizationSyncSettingsResource) Schema added in v0.0.10

func (*OrganizationSyncSettingsResource) Update added in v0.0.10

type OrganizationSyncSettingsResourceModel added in v0.0.10

type OrganizationSyncSettingsResourceModel struct {
	Field         types.String `tfsdk:"field"`
	AssignDefault types.Bool   `tfsdk:"assign_default"`
	Mapping       types.Map    `tfsdk:"mapping"`
}

OrganizationSyncSettingsResourceModel describes the resource data model.

type Permission

type Permission struct {
	// Purposefully left as a string so we can later support an `everyone` shortcut
	// identifier for the Everyone group.
	ID   types.String `tfsdk:"id"`
	Role types.String `tfsdk:"role"`
}

type PreviousTemplateVersion

type PreviousTemplateVersion struct {
	ID     uuid.UUID         `json:"id"`
	Name   string            `json:"name"`
	TFVars map[string]string `json:"tf_vars"`
	Active bool              `json:"active"`
}

type ProvisionerKeyResource added in v0.0.8

type ProvisionerKeyResource struct {
	*CoderdProviderData
}

ProvisionerKeyResource defines the resource implementation.

func (*ProvisionerKeyResource) Configure added in v0.0.8

func (*ProvisionerKeyResource) Create added in v0.0.8

func (*ProvisionerKeyResource) Delete added in v0.0.8

func (*ProvisionerKeyResource) Metadata added in v0.0.8

func (*ProvisionerKeyResource) Read added in v0.0.8

func (*ProvisionerKeyResource) Schema added in v0.0.8

func (*ProvisionerKeyResource) Update added in v0.0.8

type ProvisionerKeyResourceModel added in v0.0.8

type ProvisionerKeyResourceModel struct {
	OrganizationID UUID         `tfsdk:"organization_id"`
	Name           types.String `tfsdk:"name"`
	Tags           types.Map    `tfsdk:"tags"`
	Key            types.String `tfsdk:"key"`
}

ProvisionerKeyResourceModel describes the resource data model.

type RoleSyncModel added in v0.0.8

type RoleSyncModel struct {
	Field   types.String `tfsdk:"field"`
	Mapping types.Map    `tfsdk:"mapping"`
}

func (RoleSyncModel) ValueObject added in v0.0.8

func (m RoleSyncModel) ValueObject() types.Object

type TemplateDataSource

type TemplateDataSource struct {
	// contains filtered or unexported fields
}

TemplateDataSource defines the data source implementation.

func (*TemplateDataSource) Configure

func (*TemplateDataSource) Metadata

func (*TemplateDataSource) Read

func (*TemplateDataSource) Schema

type TemplateDataSourceModel

type TemplateDataSourceModel struct {
	// ((Organization and Name) or ID) must be set
	OrganizationID UUID         `tfsdk:"organization_id"`
	ID             UUID         `tfsdk:"id"`
	Name           types.String `tfsdk:"name"`

	DisplayName types.String `tfsdk:"display_name"`
	// TODO: Provisioner
	Description        types.String `tfsdk:"description"`
	ActiveVersionID    UUID         `tfsdk:"active_version_id"`
	ActiveUserCount    types.Int64  `tfsdk:"active_user_count"`
	Deprecated         types.Bool   `tfsdk:"deprecated"`
	DeprecationMessage types.String `tfsdk:"deprecation_message"`
	Icon               types.String `tfsdk:"icon"`

	DefaultTTLMillis             types.Int64  `tfsdk:"default_ttl_ms"`
	ActivityBumpMillis           types.Int64  `tfsdk:"activity_bump_ms"`
	AutostopRequirement          types.Object `tfsdk:"auto_stop_requirement"`
	AutostartPermittedDaysOfWeek types.Set    `tfsdk:"auto_start_permitted_days_of_week"`

	AllowUserAutostart           types.Bool `tfsdk:"allow_user_autostart"`
	AllowUserAutostop            types.Bool `tfsdk:"allow_user_autostop"`
	AllowUserCancelWorkspaceJobs types.Bool `tfsdk:"allow_user_cancel_workspace_jobs"`

	FailureTTLMillis               types.Int64 `tfsdk:"failure_ttl_ms"`
	TimeTilDormantMillis           types.Int64 `tfsdk:"time_til_dormant_ms"`
	TimeTilDormantAutoDeleteMillis types.Int64 `tfsdk:"time_til_dormant_autodelete_ms"`

	RequireActiveVersion types.Bool   `tfsdk:"require_active_version"`
	AgentsAllowed        types.Bool   `tfsdk:"agents_allowed"`
	MaxPortShareLevel    types.String `tfsdk:"max_port_share_level"`
	CORSBehavior         types.String `tfsdk:"cors_behavior"`

	CreatedByUserID UUID        `tfsdk:"created_by_user_id"`
	CreatedAt       types.Int64 `tfsdk:"created_at"` // Unix timestamp
	UpdatedAt       types.Int64 `tfsdk:"updated_at"` // Unix timestamp

	ACL types.Object `tfsdk:"acl"`
}

TemplateDataSourceModel describes the data source data model.

type TemplateResource

type TemplateResource struct {
	// contains filtered or unexported fields
}

TemplateResource defines the resource implementation.

func (*TemplateResource) ConfigValidators

func (r *TemplateResource) ConfigValidators(context.Context) []resource.ConfigValidator

ConfigValidators implements resource.ResourceWithConfigValidators.

func (*TemplateResource) Configure

func (*TemplateResource) Create

func (*TemplateResource) Delete

func (*TemplateResource) ImportState

func (*TemplateResource) Metadata

func (*TemplateResource) Read

func (*TemplateResource) Schema

func (*TemplateResource) Update

type TemplateResourceModel

type TemplateResourceModel struct {
	ID UUID `tfsdk:"id"`

	Name                           types.String `tfsdk:"name"`
	DisplayName                    types.String `tfsdk:"display_name"`
	Description                    types.String `tfsdk:"description"`
	OrganizationID                 UUID         `tfsdk:"organization_id"`
	Icon                           types.String `tfsdk:"icon"`
	DefaultTTLMillis               types.Int64  `tfsdk:"default_ttl_ms"`
	ActivityBumpMillis             types.Int64  `tfsdk:"activity_bump_ms"`
	AutostopRequirement            types.Object `tfsdk:"auto_stop_requirement"`
	AutostartPermittedDaysOfWeek   types.Set    `tfsdk:"auto_start_permitted_days_of_week"`
	AllowUserCancelWorkspaceJobs   types.Bool   `tfsdk:"allow_user_cancel_workspace_jobs"`
	AllowUserAutostart             types.Bool   `tfsdk:"allow_user_auto_start"`
	AllowUserAutostop              types.Bool   `tfsdk:"allow_user_auto_stop"`
	FailureTTLMillis               types.Int64  `tfsdk:"failure_ttl_ms"`
	TimeTilDormantMillis           types.Int64  `tfsdk:"time_til_dormant_ms"`
	TimeTilDormantAutoDeleteMillis types.Int64  `tfsdk:"time_til_dormant_autodelete_ms"`
	RequireActiveVersion           types.Bool   `tfsdk:"require_active_version"`
	DeprecationMessage             types.String `tfsdk:"deprecation_message"`
	MaxPortShareLevel              types.String `tfsdk:"max_port_share_level"`
	CORSBehavior                   types.String `tfsdk:"cors_behavior"`
	UseClassicParameterFlow        types.Bool   `tfsdk:"use_classic_parameter_flow"`
	AgentsAllowed                  types.Bool   `tfsdk:"agents_allowed"`

	// If null, we are not managing ACL via Terraform (such as for AGPL).
	ACL      types.Object `tfsdk:"acl"`
	Versions Versions     `tfsdk:"versions"`
}

TemplateResourceModel describes the resource data model.

func (*TemplateResourceModel) CheckEntitlements

func (m *TemplateResourceModel) CheckEntitlements(ctx context.Context, features map[codersdk.FeatureName]codersdk.Feature) (diags diag.Diagnostics)

func (*TemplateResourceModel) EqualTemplateMetadata

func (m *TemplateResourceModel) EqualTemplateMetadata(other *TemplateResourceModel) bool

EqualTemplateMetadata returns true if two templates have identical metadata (excluding ACL).

type TemplateVersion

type TemplateVersion struct {
	ID                 UUID         `tfsdk:"id"`
	Name               types.String `tfsdk:"name"`
	Message            types.String `tfsdk:"message"`
	Directory          types.String `tfsdk:"directory"`
	DirectoryHash      types.String `tfsdk:"directory_hash"`
	Active             types.Bool   `tfsdk:"active"`
	TerraformVariables types.Set    `tfsdk:"tf_vars"`
	ProvisionerTags    types.Set    `tfsdk:"provisioner_tags"`
}

type UUID

type UUID struct {
	// The framework requires custom types extend a primitive or object.
	basetypes.StringValue
	// contains filtered or unexported fields
}

func NewUUIDNull

func NewUUIDNull() UUID

func NewUUIDUnknown

func NewUUIDUnknown() UUID

func UUIDValue

func UUIDValue(value uuid.UUID) UUID

func (UUID) Equal

func (v UUID) Equal(o attr.Value) bool

Equal implements basetypes.StringValuable.

func (UUID) Type

func (v UUID) Type(context.Context) attr.Type

Type implements basetypes.StringValuable.

func (UUID) ValidateAttribute

func (v UUID) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)

ValidateAttribute implements xattr.ValidateableAttribute.

func (UUID) ValueUUID

func (v UUID) ValueUUID() uuid.UUID

ValueUUID returns the UUID value. If the value is null or unknown, returns the Nil UUID.

type UserDataSource

type UserDataSource struct {
	// contains filtered or unexported fields
}

UserDataSource defines the data source implementation.

func (*UserDataSource) ConfigValidators

func (d *UserDataSource) ConfigValidators(context.Context) []datasource.ConfigValidator

func (*UserDataSource) Configure

func (*UserDataSource) Metadata

func (*UserDataSource) Read

func (*UserDataSource) Schema

type UserDataSourceModel

type UserDataSourceModel struct {
	// At least one identifier must be set.
	ID       UUID         `tfsdk:"id"`
	Username types.String `tfsdk:"username"`

	Name             types.String `tfsdk:"name"`
	Email            types.String `tfsdk:"email"`
	Roles            types.Set    `tfsdk:"roles"`      // owner, template-admin, user-admin, auditor (member is implicit)
	LoginType        types.String `tfsdk:"login_type"` // none, password, github, oidc
	Suspended        types.Bool   `tfsdk:"suspended"`
	IsServiceAccount types.Bool   `tfsdk:"is_service_account"`
	AvatarURL        types.String `tfsdk:"avatar_url"`
	OrganizationIDs  types.Set    `tfsdk:"organization_ids"`
	CreatedAt        types.Int64  `tfsdk:"created_at"` // Unix timestamp
	LastSeenAt       types.Int64  `tfsdk:"last_seen_at"`
}

UserDataSourceModel describes the data source data model.

type UserResource

type UserResource struct {
	// contains filtered or unexported fields
}

UserResource defines the resource implementation.

func (*UserResource) Configure

func (*UserResource) Create

func (*UserResource) Delete

func (*UserResource) ImportState

Req.ID can be either a UUID or a username.

func (*UserResource) Metadata

func (*UserResource) Read

func (*UserResource) Schema

func (*UserResource) Update

func (*UserResource) ValidateConfig added in v0.0.17

type UserResourceModel

type UserResourceModel struct {
	ID UUID `tfsdk:"id"`

	Username         types.String `tfsdk:"username"`
	Name             types.String `tfsdk:"name"`
	Email            types.String `tfsdk:"email"`
	Roles            types.Set    `tfsdk:"roles"`      // owner, template-admin, user-admin, auditor (member is implicit)
	LoginType        types.String `tfsdk:"login_type"` // none, password, github, oidc
	Password         types.String `tfsdk:"password"`   // only when login_type is password
	Suspended        types.Bool   `tfsdk:"suspended"`
	IsServiceAccount types.Bool   `tfsdk:"is_service_account"`
}

UserResourceModel describes the resource data model.

type Variable

type Variable struct {
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

type Versions

type Versions []TemplateVersion

func (Versions) ByID

func (v Versions) ByID(id UUID) *TemplateVersion

type WorkspaceProxyResource

type WorkspaceProxyResource struct {
	// contains filtered or unexported fields
}

WorkspaceProxyResource defines the resource implementation.

func (*WorkspaceProxyResource) Configure

func (*WorkspaceProxyResource) Create

func (*WorkspaceProxyResource) Delete

func (*WorkspaceProxyResource) Metadata

func (*WorkspaceProxyResource) Read

func (*WorkspaceProxyResource) Schema

func (*WorkspaceProxyResource) Update

type WorkspaceProxyResourceModel

type WorkspaceProxyResourceModel struct {
	ID           UUID         `tfsdk:"id"`
	Name         types.String `tfsdk:"name"`
	DisplayName  types.String `tfsdk:"display_name"`
	Icon         types.String `tfsdk:"icon"`
	SessionToken types.String `tfsdk:"session_token"`
}

WorkspaceProxyResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL