schema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schema describes provider schemas independently of the plugin protocol version (5 or 6) the provider speaks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Type       cty.Type
	NestedType *Object

	Required   bool
	Optional   bool
	Computed   bool
	Sensitive  bool
	Deprecated bool
	WriteOnly  bool
}

Attribute is a single argument of a block. Exactly one of Type and NestedType is set; NestedType is only used by protocol 6 providers.

func (*Attribute) ImpliedType

func (a *Attribute) ImpliedType() cty.Type

ImpliedType is the cty type of values that conform to the attribute.

func (*Attribute) IsConfigurable

func (a *Attribute) IsConfigurable() bool

IsConfigurable reports whether the attribute can be written in configuration, as opposed to being set only by the provider.

type Block

type Block struct {
	Attributes map[string]*Attribute
	BlockTypes map[string]*NestedBlock
	Deprecated bool
}

Block is the body of a resource, a data source, a provider configuration or a nested block.

func (*Block) CoerceValue

func (b *Block) CoerceValue(in cty.Value) (cty.Value, error)

CoerceValue turns a partial object, such as a provider configuration built from command line flags, into a value of the block's implied type: missing attributes become null and missing nested blocks become empty.

func (*Block) ImpliedType

func (b *Block) ImpliedType() cty.Type

ImpliedType is the cty type of values that conform to the block.

type NestedBlock

type NestedBlock struct {
	Block
	Nesting  NestingMode
	MinItems int
	MaxItems int
}

NestedBlock is a block type that can appear inside another block.

func (*NestedBlock) ImpliedType

func (nb *NestedBlock) ImpliedType() cty.Type

ImpliedType is the cty type of the collection of nested blocks.

type NestingMode

type NestingMode int

NestingMode says how a nested block or a nested attribute object repeats.

const (
	NestingSingle NestingMode = iota
	NestingGroup
	NestingList
	NestingSet
	NestingMap
)

type Object

type Object struct {
	Attributes map[string]*Attribute
	Nesting    NestingMode
}

Object is the type of a protocol 6 nested attribute.

func (*Object) ImpliedType

func (o *Object) ImpliedType() cty.Type

ImpliedType is the cty type of values that conform to the nested object.

type Provider

type Provider struct {
	Provider      *Block
	ResourceTypes map[string]Resource
	DataSources   map[string]Resource
	ListResources map[string]Resource
}

Provider is everything a provider reports about itself.

type Resource

type Resource struct {
	Version int64
	Block   *Block
}

Resource is the schema of a managed resource, data source or list resource type.

Jump to

Keyboard shortcuts

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