framework

package
v0.0.0-...-3ef020b Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() provider.Provider

func NewBoolFunction

func NewBoolFunction() function.Function

func NewDeferredActionPlanModificationResource

func NewDeferredActionPlanModificationResource() resource.Resource

func NewDeferredActionResource

func NewDeferredActionResource() resource.Resource

func NewDynamicComputedTypeChangeResource

func NewDynamicComputedTypeChangeResource() resource.Resource

func NewDynamicFunction

func NewDynamicFunction() function.Function

func NewDynamicSchemaResource

func NewDynamicSchemaResource() resource.Resource

func NewDynamicVariadicFunction

func NewDynamicVariadicFunction() function.Function

func NewEphemeralLifecycleResource

func NewEphemeralLifecycleResource() ephemeral.EphemeralResource

func NewFloat32Function

func NewFloat32Function() function.Function

func NewFloat32PrecisionResource

func NewFloat32PrecisionResource() resource.Resource

func NewFloat64Function

func NewFloat64Function() function.Function

func NewFloat64PrecisionResource

func NewFloat64PrecisionResource() resource.Resource

func NewInt32Function

func NewInt32Function() function.Function

func NewInt64Function

func NewInt64Function() function.Function

func NewListFunction

func NewListFunction() function.Function

func NewMapFunction

func NewMapFunction() function.Function

func NewMoveStateResource

func NewMoveStateResource() resource.Resource

func NewNumberFunction

func NewNumberFunction() function.Function

func NewObjectFunction

func NewObjectFunction() function.Function

func NewObjectWithDynamicFunction

func NewObjectWithDynamicFunction() function.Function

func NewSchemaEphemeralResource

func NewSchemaEphemeralResource() ephemeral.EphemeralResource

func NewSchemaResource

func NewSchemaResource() resource.Resource

func NewSetFunction

func NewSetFunction() function.Function

func NewSetNestedBlockWithDefaultsResource

func NewSetNestedBlockWithDefaultsResource() resource.Resource

func NewStringFunction

func NewStringFunction() function.Function

func NewTFSDKReflectionResource

func NewTFSDKReflectionResource() resource.Resource

func NewTimeTypesResource

func NewTimeTypesResource() resource.Resource

func NewTimeoutsResource

func NewTimeoutsResource() resource.Resource

func NewUserResource

func NewUserResource() resource.Resource

func NewVariadicFunction

func NewVariadicFunction() function.Function

func NewWithEphemeralSpy

func NewWithEphemeralSpy(spy *EphemeralResourceSpyClient) provider.Provider

Types

type BoolFunction

type BoolFunction struct{}

func (BoolFunction) Definition

func (BoolFunction) Metadata

func (BoolFunction) Run

type CollectionAttrs

type CollectionAttrs struct {
	ConfigList   []string   `tfsdk:"config_list"`
	ComputedList types.List `tfsdk:"computed_list"`

	MapAttrs

	ExplicitIgnore string `tfsdk:"-"`
	// contains filtered or unexported fields
}

type CollectionBlocks

type CollectionBlocks struct {
	ExplicitIgnore string `tfsdk:"-"`
	// contains filtered or unexported fields
}

type DeferredActionResource

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

DeferredActionResource is for testing all schema types.

func (*DeferredActionResource) Create

func (*DeferredActionResource) Delete

func (*DeferredActionResource) ImportState

func (*DeferredActionResource) Metadata

func (*DeferredActionResource) ModifyPlan

func (*DeferredActionResource) Read

func (*DeferredActionResource) Schema

func (*DeferredActionResource) Update

type DeferredActionResourceModel

type DeferredActionResourceModel struct {
	ModifyPlanDeferral types.Bool   `tfsdk:"modify_plan_deferral"`
	ReadDeferral       types.Bool   `tfsdk:"read_deferral"`
	ID                 types.String `tfsdk:"id"`
}

type DynamicComputedTypeChangeResource

type DynamicComputedTypeChangeResource struct{}

DynamicComputedTypeChangeResource is for testing the ability of a computed dynamic attribute type to change on apply (update) when unknown Ref: https://github.com/hashicorp/terraform-plugin-framework/issues/969

func (DynamicComputedTypeChangeResource) Create

func (DynamicComputedTypeChangeResource) Delete

func (DynamicComputedTypeChangeResource) Metadata

func (DynamicComputedTypeChangeResource) Read

func (DynamicComputedTypeChangeResource) Schema

func (DynamicComputedTypeChangeResource) Update

type DynamicComputedTypeChangeResourceModel

type DynamicComputedTypeChangeResourceModel struct {
	RequiredDynamic            types.Dynamic `tfsdk:"required_dynamic"`
	ComputedDynamicTypeChanges types.Dynamic `tfsdk:"computed_dynamic_type_changes"`
}

type DynamicFunction

type DynamicFunction struct{}

func (DynamicFunction) Definition

func (DynamicFunction) Metadata

func (DynamicFunction) Run

type DynamicSchemaResource

type DynamicSchemaResource struct{}

DynamicSchemaResource is for testing the dynamic schema type.

This is separated from the standard `SchemaResource` for protocol v5 because of a bug in Terraform v0.12.x around handling null values. See this resource's acceptance tests for more details.

func (DynamicSchemaResource) Create

func (DynamicSchemaResource) Delete

func (DynamicSchemaResource) Metadata

func (DynamicSchemaResource) Read

func (DynamicSchemaResource) Schema

func (DynamicSchemaResource) Update

type DynamicSchemaResourceModel

type DynamicSchemaResourceModel struct {
	DynamicAttribute             types.Dynamic `tfsdk:"dynamic_attribute"`
	ObjectAttributeWithDynamic   types.Object  `tfsdk:"object_attribute_with_dynamic"`
	SingleNestedBlockWithDynamic types.Object  `tfsdk:"single_nested_block_with_dynamic"`
}

type DynamicVariadicFunction

type DynamicVariadicFunction struct{}

func (DynamicVariadicFunction) Definition

func (DynamicVariadicFunction) Metadata

func (DynamicVariadicFunction) Run

type EmbedIgnore

type EmbedIgnore struct {
	Field2 string
}

type EphemeralLifecycleResource

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

EphemeralLifecycleResource is for testing the ephemeral resource lifecycle (Open, Renew, Close)

func (*EphemeralLifecycleResource) Close

func (*EphemeralLifecycleResource) Configure

func (*EphemeralLifecycleResource) Metadata

func (*EphemeralLifecycleResource) Open

func (*EphemeralLifecycleResource) Renew

func (*EphemeralLifecycleResource) Schema

type EphemeralLifecycleResourceModel

type EphemeralLifecycleResourceModel struct {
	Name  types.String `tfsdk:"name"`
	Token types.String `tfsdk:"token"`
}

type EphemeralResourceSpyClient

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

EphemeralResourceSpyClient is used in tests to verify that an ephemeral resource lifecycle handler has been executed.

func (*EphemeralResourceSpyClient) Close

func (e *EphemeralResourceSpyClient) Close()

Close will increment the number of invocations for this instance, which can be retrieved with the `CloseInvocations` method

func (*EphemeralResourceSpyClient) CloseInvocations

func (e *EphemeralResourceSpyClient) CloseInvocations() int

CloseInvocations returns the number of times the `Close` method has been called on this instance.

func (*EphemeralResourceSpyClient) Renew

func (e *EphemeralResourceSpyClient) Renew()

Renew will increment the number of invocations for this instance, which can be retrieved with the `RenewInvocations` method

func (*EphemeralResourceSpyClient) RenewInvocations

func (e *EphemeralResourceSpyClient) RenewInvocations() int

RenewInvocations returns the number of times the `Renew` method has been called on this instance.

type Float32Function

type Float32Function struct{}

func (Float32Function) Definition

func (Float32Function) Metadata

func (Float32Function) Run

type Float32PrecisionResource

type Float32PrecisionResource struct{}

Float32PrecisionResource is for testing Float32/cty.Number quirks https://github.com/hashicorp/terraform-plugin-framework/issues/815

func (Float32PrecisionResource) Create

func (Float32PrecisionResource) Delete

func (Float32PrecisionResource) Metadata

func (Float32PrecisionResource) Read

func (Float32PrecisionResource) Schema

func (Float32PrecisionResource) Update

type Float32PrecisionResourceModel

type Float32PrecisionResourceModel struct {
	Float32Attribute types.Float32 `tfsdk:"float32_attribute"`
}

type Float64Function

type Float64Function struct{}

func (Float64Function) Definition

func (Float64Function) Metadata

func (Float64Function) Run

type Float64PrecisionResource

type Float64PrecisionResource struct{}

Float64PrecisionResource is for testing Float64/cty.Number quirks https://github.com/hashicorp/terraform-plugin-framework/issues/815

func (Float64PrecisionResource) Create

func (Float64PrecisionResource) Delete

func (Float64PrecisionResource) Metadata

func (Float64PrecisionResource) Read

func (Float64PrecisionResource) Schema

func (Float64PrecisionResource) Update

type Float64PrecisionResourceModel

type Float64PrecisionResourceModel struct {
	Float64Attribute types.Float64 `tfsdk:"float64_attribute"`
}

type Int32Function

type Int32Function struct{}

func (Int32Function) Definition

func (Int32Function) Metadata

func (Int32Function) Run

type Int64Function

type Int64Function struct{}

func (Int64Function) Definition

func (Int64Function) Metadata

func (Int64Function) Run

type ListFunction

type ListFunction struct{}

func (ListFunction) Definition

func (ListFunction) Metadata

func (ListFunction) Run

type MapAttrs

type MapAttrs struct {
	ConfigMap   map[string]string `tfsdk:"config_map"`
	ComputedMap types.Map         `tfsdk:"computed_map"`

	ExplicitIgnore string `tfsdk:"-"`
	// contains filtered or unexported fields
}

type MapFunction

type MapFunction struct{}

func (MapFunction) Definition

func (MapFunction) Metadata

func (MapFunction) Run

type MoveStateResource

type MoveStateResource struct{}

MoveStateResource is for testing the MoveResourceState RPC https://developer.hashicorp.com/terraform/plugin/framework/resources/state-move

func (MoveStateResource) Create

func (MoveStateResource) Delete

func (MoveStateResource) Metadata

func (MoveStateResource) MoveState

func (MoveStateResource) Read

func (MoveStateResource) Schema

func (MoveStateResource) Update

type MoveStateResourceModel

type MoveStateResourceModel struct {
	MovedRandomString types.String `tfsdk:"moved_random_string"`
}

type NumberFunction

type NumberFunction struct{}

func (NumberFunction) Definition

func (NumberFunction) Metadata

func (NumberFunction) Run

type ObjectFunction

type ObjectFunction struct{}

func (ObjectFunction) Definition

func (ObjectFunction) Metadata

func (ObjectFunction) Run

type ObjectWithDynamicFunction

type ObjectWithDynamicFunction struct{}

func (ObjectWithDynamicFunction) Definition

func (ObjectWithDynamicFunction) Metadata

func (ObjectWithDynamicFunction) Run

type SchemaEphemeralResource

type SchemaEphemeralResource struct{}

SchemaEphemeralResource is for testing all schema types

func (SchemaEphemeralResource) Metadata

func (SchemaEphemeralResource) Open

func (SchemaEphemeralResource) Schema

type SchemaEphemeralResourceModel

type SchemaEphemeralResourceModel struct {
	BoolAttribute     types.Bool    `tfsdk:"bool_attribute"`
	DynamicAttribute  types.Dynamic `tfsdk:"dynamic_attribute"`
	Float32Attribute  types.Float32 `tfsdk:"float32_attribute"`
	Float64Attribute  types.Float64 `tfsdk:"float64_attribute"`
	Int32attribute    types.Int32   `tfsdk:"int32_attribute"`
	Int64Attribute    types.Int64   `tfsdk:"int64_attribute"`
	ListAttribute     types.List    `tfsdk:"list_attribute"`
	ListNestedBlock   types.List    `tfsdk:"list_nested_block"`
	MapAttribute      types.Map     `tfsdk:"map_attribute"`
	NumberAttribute   types.Number  `tfsdk:"number_attribute"`
	ObjectAttribute   types.Object  `tfsdk:"object_attribute"`
	SetAttribute      types.Set     `tfsdk:"set_attribute"`
	SetNestedBlock    types.Set     `tfsdk:"set_nested_block"`
	SingleNestedBlock types.Object  `tfsdk:"single_nested_block"`
	StringAttribute   types.String  `tfsdk:"string_attribute"`
}

type SchemaResource

type SchemaResource struct{}

SchemaResource is for testing all schema types, excluding dynamic schema types. (see `DynamicSchemaResource`)

func (SchemaResource) Create

func (SchemaResource) Delete

func (SchemaResource) Metadata

func (SchemaResource) Read

func (SchemaResource) Schema

func (SchemaResource) Update

type SchemaResourceModel

type SchemaResourceModel struct {
	BoolAttribute     types.Bool    `tfsdk:"bool_attribute"`
	Float32Attribute  types.Float32 `tfsdk:"float32_attribute"`
	Float64Attribute  types.Float64 `tfsdk:"float64_attribute"`
	Int32attribute    types.Int32   `tfsdk:"int32_attribute"`
	Int64Attribute    types.Int64   `tfsdk:"int64_attribute"`
	ListAttribute     types.List    `tfsdk:"list_attribute"`
	ListNestedBlock   types.List    `tfsdk:"list_nested_block"`
	MapAttribute      types.Map     `tfsdk:"map_attribute"`
	NumberAttribute   types.Number  `tfsdk:"number_attribute"`
	ObjectAttribute   types.Object  `tfsdk:"object_attribute"`
	SetAttribute      types.Set     `tfsdk:"set_attribute"`
	SetNestedBlock    types.Set     `tfsdk:"set_nested_block"`
	SingleNestedBlock types.Object  `tfsdk:"single_nested_block"`
	StringAttribute   types.String  `tfsdk:"string_attribute"`
}

type SetFunction

type SetFunction struct{}

func (SetFunction) Definition

func (SetFunction) Metadata

func (SetFunction) Run

type SetNestedBlockWithDefaultsResource

type SetNestedBlockWithDefaultsResource struct{}

SetNestedBlockWithDefaultsResource is used for a test asserting a bug that has yet to be fixed in plugin framework with defaults being used in an attribute inside of a set.

This bug can be observed with various different outcomes: producing duplicate set element errors, incorrect diffs during plan, consistent diffs with values switching back and forth, etc. Example bug reports:

func (SetNestedBlockWithDefaultsResource) Create

func (SetNestedBlockWithDefaultsResource) Delete

func (SetNestedBlockWithDefaultsResource) Metadata

func (SetNestedBlockWithDefaultsResource) Read

func (SetNestedBlockWithDefaultsResource) Schema

func (SetNestedBlockWithDefaultsResource) Update

type SetNestedBlockWithDefaultsResourceModel

type SetNestedBlockWithDefaultsResourceModel struct {
	Set types.Set `tfsdk:"set"`
}

type StringFunction

type StringFunction struct{}

func (StringFunction) Definition

func (StringFunction) Metadata

func (StringFunction) Run

type TFSDKReflectionResource

type TFSDKReflectionResource struct{}

TFSDKReflectionResource is a smoke test for reflection logic on objects using the `tfsdk` field tags.

func (TFSDKReflectionResource) Create

func (TFSDKReflectionResource) Delete

func (TFSDKReflectionResource) Metadata

func (TFSDKReflectionResource) Read

func (TFSDKReflectionResource) Schema

func (TFSDKReflectionResource) Update

type TFSDKReflectionResourceModel

type TFSDKReflectionResourceModel struct {
	ConfigDynamic   types.Dynamic `tfsdk:"config_dynamic"`
	ComputedDynamic types.Dynamic `tfsdk:"computed_dynamic"`

	CollectionAttrs

	CollectionBlocks

	ExplicitIgnore string `tfsdk:"-"`

	*EmbedIgnore `tfsdk:"-"`
	// contains filtered or unexported fields
}

type TimeTypesResource

type TimeTypesResource struct{}

TimeTypesResource is for testing all schema types.

func (TimeTypesResource) Create

func (TimeTypesResource) Delete

func (TimeTypesResource) Metadata

func (TimeTypesResource) Read

func (TimeTypesResource) Schema

func (TimeTypesResource) Update

type TimeTypesResourceModel

type TimeTypesResourceModel struct {
	GoDuration timetypes.GoDuration `tfsdk:"go_duration"`
	Rfc3339    timetypes.RFC3339    `tfsdk:"rfc3339"`
}

type TimeoutsResource

type TimeoutsResource struct{}

TimeoutsResource is for testing all schema types.

func (TimeoutsResource) Create

func (TimeoutsResource) Delete

func (TimeoutsResource) Metadata

func (TimeoutsResource) Read

func (TimeoutsResource) Schema

func (TimeoutsResource) Update

type TimeoutsResourceModel

type TimeoutsResourceModel struct {
	Timeouts timeouts.Value `tfsdk:"timeouts"`
}

type VariadicFunction

type VariadicFunction struct{}

func (VariadicFunction) Definition

func (VariadicFunction) Metadata

func (VariadicFunction) Run

Jump to

Keyboard shortcuts

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