tfschema

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAppV3FromTerraform

CopyAppV3FromTerraform copies contents of the source Terraform object into a target struct

func CopyAppV3ToTerraform

CopyAppV3ToTerraform copies contents of the source Terraform object into a target struct

func CopyAuthPreferenceV2FromTerraform

CopyAuthPreferenceV2FromTerraform copies contents of the source Terraform object into a target struct

func CopyAuthPreferenceV2ToTerraform

CopyAuthPreferenceV2ToTerraform copies contents of the source Terraform object into a target struct

func CopyClusterMaintenanceConfigV1FromTerraform

CopyClusterMaintenanceConfigV1FromTerraform copies contents of the source Terraform object into a target struct

func CopyClusterMaintenanceConfigV1ToTerraform

CopyClusterMaintenanceConfigV1ToTerraform copies contents of the source Terraform object into a target struct

func CopyClusterNetworkingConfigV2FromTerraform

CopyClusterNetworkingConfigV2FromTerraform copies contents of the source Terraform object into a target struct

func CopyClusterNetworkingConfigV2ToTerraform

CopyClusterNetworkingConfigV2ToTerraform copies contents of the source Terraform object into a target struct

func CopyDatabaseV3FromTerraform

CopyDatabaseV3FromTerraform copies contents of the source Terraform object into a target struct

func CopyDatabaseV3ToTerraform

CopyDatabaseV3ToTerraform copies contents of the source Terraform object into a target struct

func CopyFromBoolOption

func CopyFromBoolOption(diags diag.Diagnostics, tf attr.Value, o **apitypes.BoolOption)

func CopyFromLabels

func CopyFromLabels(diags diag.Diagnostics, v attr.Value, o *apitypes.Labels)

func CopyFromStrings

func CopyFromStrings(diags diag.Diagnostics, v attr.Value, o *wrappers.Strings)

CopyFromStrings converts from a Terraform value into a Teleport wrappers.Strings The received value must be of List type

func CopyFromTraits

func CopyFromTraits(diags diag.Diagnostics, v attr.Value, o *wrappers.Traits)

func CopyGithubConnectorV3FromTerraform

CopyGithubConnectorV3FromTerraform copies contents of the source Terraform object into a target struct

func CopyGithubConnectorV3ToTerraform

CopyGithubConnectorV3ToTerraform copies contents of the source Terraform object into a target struct

func CopyOIDCConnectorV3FromTerraform

CopyOIDCConnectorV3FromTerraform copies contents of the source Terraform object into a target struct

func CopyOIDCConnectorV3ToTerraform

CopyOIDCConnectorV3ToTerraform copies contents of the source Terraform object into a target struct

func CopyOktaImportRuleV1FromTerraform

CopyOktaImportRuleV1FromTerraform copies contents of the source Terraform object into a target struct

func CopyOktaImportRuleV1ToTerraform

CopyOktaImportRuleV1ToTerraform copies contents of the source Terraform object into a target struct

func CopyProvisionTokenV2FromTerraform

CopyProvisionTokenV2FromTerraform copies contents of the source Terraform object into a target struct

func CopyProvisionTokenV2ToTerraform

CopyProvisionTokenV2ToTerraform copies contents of the source Terraform object into a target struct

func CopyRoleV6FromTerraform

CopyRoleV6FromTerraform copies contents of the source Terraform object into a target struct

func CopyRoleV6ToTerraform

CopyRoleV6ToTerraform copies contents of the source Terraform object into a target struct

func CopySAMLConnectorV2FromTerraform

CopySAMLConnectorV2FromTerraform copies contents of the source Terraform object into a target struct

func CopySAMLConnectorV2ToTerraform

CopySAMLConnectorV2ToTerraform copies contents of the source Terraform object into a target struct

func CopySessionRecordingConfigV2FromTerraform

CopySessionRecordingConfigV2FromTerraform copies contents of the source Terraform object into a target struct

func CopySessionRecordingConfigV2ToTerraform

CopySessionRecordingConfigV2ToTerraform copies contents of the source Terraform object into a target struct

func CopyToBoolOption

func CopyToBoolOption(diags diag.Diagnostics, o *apitypes.BoolOption, t attr.Type, v attr.Value) attr.Value

func CopyToLabels

func CopyToLabels(diags diag.Diagnostics, o apitypes.Labels, t attr.Type, v attr.Value) attr.Value

func CopyToStrings

func CopyToStrings(diags diag.Diagnostics, o wrappers.Strings, t attr.Type, v attr.Value) attr.Value

CopyFromStrings converts from a Teleport wrappers.Strings into a Terraform List with ElemType of String

func CopyToTraits

func CopyToTraits(diags diag.Diagnostics, o wrappers.Traits, t attr.Type, v attr.Value) attr.Value

func CopyTrustedClusterV2FromTerraform

CopyTrustedClusterV2FromTerraform copies contents of the source Terraform object into a target struct

func CopyTrustedClusterV2ToTerraform

CopyTrustedClusterV2ToTerraform copies contents of the source Terraform object into a target struct

func CopyUserV2FromTerraform

CopyUserV2FromTerraform copies contents of the source Terraform object into a target struct

func CopyUserV2ToTerraform

CopyUserV2ToTerraform copies contents of the source Terraform object into a target struct

func GenSchemaAuthPreferenceV2

GenSchemaAuthPreferenceV2 returns tfsdk.Schema definition for AuthPreferenceV2

func GenSchemaBoolOption

func GenSchemaBoolOption(_ context.Context) tfsdk.Attribute

GenSchemaBoolOptions returns Terraform schema for BoolOption type

func GenSchemaClusterMaintenanceConfigV1

GenSchemaClusterMaintenanceConfigV1 returns tfsdk.Schema definition for ClusterMaintenanceConfigV1

func GenSchemaClusterNetworkingConfigV2

GenSchemaClusterNetworkingConfigV2 returns tfsdk.Schema definition for ClusterNetworkingConfigV2

func GenSchemaDatabaseV3

GenSchemaDatabaseV3 returns tfsdk.Schema definition for DatabaseV3

func GenSchemaGithubConnectorV3

GenSchemaGithubConnectorV3 returns tfsdk.Schema definition for GithubConnectorV3

func GenSchemaLabels

func GenSchemaLabels(ctx context.Context) tfsdk.Attribute

GenSchemaBoolOptions returns Terraform schema for Labels type

func GenSchemaOIDCConnectorV3

GenSchemaOIDCConnectorV3 returns tfsdk.Schema definition for OIDCConnectorV3

func GenSchemaOktaImportRuleV1

GenSchemaOktaImportRuleV1 returns tfsdk.Schema definition for OktaImportRuleV1

func GenSchemaProvisionTokenV2

GenSchemaProvisionTokenV2 returns tfsdk.Schema definition for ProvisionTokenV2

func GenSchemaRoleV6

GenSchemaRoleV6 returns tfsdk.Schema definition for RoleV6

func GenSchemaSAMLConnectorV2

GenSchemaSAMLConnectorV2 returns tfsdk.Schema definition for SAMLConnectorV2

func GenSchemaSessionRecordingConfigV2

GenSchemaSessionRecordingConfigV2 returns tfsdk.Schema definition for SessionRecordingConfigV2

func GenSchemaStrings

func GenSchemaStrings(_ context.Context) tfsdk.Attribute

GenSchemaStrings returns Terraform schema for Strings type

func GenSchemaTraits

func GenSchemaTraits(_ context.Context) tfsdk.Attribute

GenSchemaBoolOptions returns Terraform schema for Traits type

func GenSchemaTrustedClusterV2

GenSchemaTrustedClusterV2 returns tfsdk.Schema definition for TrustedClusterV2

func GenSchemaUserV2

GenSchemaUserV2 returns tfsdk.Schema definition for UserV2

func MustTimeBeInFuture

func MustTimeBeInFuture() tfsdk.AttributeValidator

MustTimeBeInFuture returns TimeValueInFutureValidator

func UseAnyOfValidator

func UseAnyOfValidator(keys ...string) tfsdk.AttributeValidator

UseAnyOfValidator creates AnyOfValidator

func UseMapKeysPresentValidator

func UseMapKeysPresentValidator(keys ...string) tfsdk.AttributeValidator

UseKeysPresentValidator creates MapKeysPresentValidator

func UseVersionBetween

func UseVersionBetween(min, max int) tfsdk.AttributeValidator

UseVersionBetween creates VersionValidator

Types

type AnyOfValidator

type AnyOfValidator struct {
	Keys []string
}

AnyOfValidator validates that at least one of the attributes is set (known and not null)

func (AnyOfValidator) Description

func (v AnyOfValidator) Description(_ context.Context) string

Description returns validator description

func (AnyOfValidator) MarkdownDescription

func (v AnyOfValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns validator markdown description

func (AnyOfValidator) Validate

Validate performs the validation.

type DurationType

type DurationType struct {
	attr.Type
}

DurationType represents time.Time Terraform type which is stored in RFC3339 format, nanoseconds truncated

func (DurationType) ApplyTerraform5AttributePathStep

func (t DurationType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep is not implemented for DurationType

func (DurationType) Equal

func (t DurationType) Equal(o attr.Type) bool

Equal returns type equality

func (DurationType) String

func (t DurationType) String() string

String returns string representation of DurationType

func (DurationType) TerraformType

func (t DurationType) TerraformType(_ context.Context) tftypes.Type

TerraformType returns type which is used in Terraform status (time is stored as string)

func (DurationType) ValueFromTerraform

func (t DurationType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform decodes terraform value and returns it as DurationType

type DurationValue

type DurationValue struct {
	// Unknown will be true if the value is not yet known.
	Unknown bool
	// Null will be true if the value was not set, or was explicitly set to null.
	Null bool
	// Value contains the set value, as long as Unknown and Null are both false.
	Value time.Duration
	// contains filtered or unexported fields
}

DurationValue represents Terraform value of type DurationType

func (DurationValue) Equal

func (t DurationValue) Equal(other attr.Value) bool

Equal returns true if `other` if durations are equal

func (DurationValue) IsNull

func (t DurationValue) IsNull() bool

IsNull returns true if receiver is null

func (DurationValue) IsUnknown

func (t DurationValue) IsUnknown() bool

IsUnknown returns true if receiver is unknown

func (DurationValue) String

func (t DurationValue) String() string

String returns the string representation of the receiver

func (DurationValue) ToTerraformValue

func (t DurationValue) ToTerraformValue(ctx context.Context) (tftypes.Value, error)

ToTerraformValue returns the data contained in the *String as a string. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.

func (DurationValue) Type

Type returns value type

type MapKeysPresentValidator

type MapKeysPresentValidator struct {
	Keys []string
}

MapKeysPresentValidator validates that a map has the specified keys

func (MapKeysPresentValidator) Description

func (v MapKeysPresentValidator) Description(_ context.Context) string

Description returns validator description

func (MapKeysPresentValidator) MarkdownDescription

func (v MapKeysPresentValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns validator markdown description

func (MapKeysPresentValidator) Validate

Validate performs the validation.

type TimeType

type TimeType struct {
	attr.Type
	Format string
}

TimeType represents time.Time Terraform type which is stored in RFC3339 format, nanoseconds truncated

func UseRFC3339Time

func UseRFC3339Time() TimeType

UseRFC3339Time creates TimeType for rfc3339

func (TimeType) ApplyTerraform5AttributePathStep

func (t TimeType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep is not implemented for TimeType

func (TimeType) Equal

func (t TimeType) Equal(o attr.Type) bool

Equal returns type equality

func (TimeType) String

func (t TimeType) String() string

String returns string representation of TimeType

func (TimeType) TerraformType

func (t TimeType) TerraformType(_ context.Context) tftypes.Type

TerraformType returns type which is used in Terraform status (time is stored as string)

func (TimeType) Validate

func (t TimeType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics

Validate validates Terraform Time valud

func (TimeType) ValueFromTerraform

func (t TimeType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

ValueFromTerraform decodes terraform value and returns it as TimeType

type TimeValue

type TimeValue struct {
	// Unknown will be true if the value is not yet known.
	Unknown bool
	// Null will be true if the value was not set, or was explicitly set to null
	Null bool
	// Value contains the set value, as long as Unknown and Null are both false
	Value time.Time
	// Format is time.Time format used to parse/encode
	Format string
}

Time represents Terraform value of type TimeType

func (TimeValue) Equal

func (t TimeValue) Equal(other attr.Value) bool

Equal returns true if `other` is a *String and has the same value as `s`.

func (TimeValue) IsNull

func (t TimeValue) IsNull() bool

IsNull returns true if receiver is null

func (TimeValue) IsUnknown

func (t TimeValue) IsUnknown() bool

IsUnknown returns true if receiver is unknown

func (TimeValue) String

func (t TimeValue) String() string

String returns the string representation of the receiver

func (TimeValue) ToTerraformValue

func (t TimeValue) ToTerraformValue(ctx context.Context) (tftypes.Value, error)

ToTerraformValue returns the data contained in the *String as a string. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.

func (TimeValue) Type

func (t TimeValue) Type(_ context.Context) attr.Type

Type returns value type

type TimeValueInFutureValidator

type TimeValueInFutureValidator struct{}

TimeValueInFutureValidator ensures that a time is in the future

func (TimeValueInFutureValidator) Description

Description returns validator description

func (TimeValueInFutureValidator) MarkdownDescription

func (v TimeValueInFutureValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns validator markdown description

func (TimeValueInFutureValidator) Validate

Validate performs the validation.

type VersionValidator

type VersionValidator struct {
	Min int
	Max int
}

VersionValidator validates that a resource version is in the specified range

func (VersionValidator) Description

func (v VersionValidator) Description(_ context.Context) string

Description returns validator description

func (VersionValidator) MarkdownDescription

func (v VersionValidator) MarkdownDescription(_ context.Context) string

MarkdownDescription returns validator markdown description

func (VersionValidator) Validate

Validate performs the validation.

Directories

Path Synopsis
accesslist
v1
devicetrust
v1
loginrule
v1

Jump to

Keyboard shortcuts

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