datasource

package
v2.38.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOptionalFieldsToSchema

func AddOptionalFieldsToSchema(schema map[string]*schema.Schema, keys ...string)

AddOptionalFieldsToSchema

code imported from Google's terraform provider. source: https://github.com/hashicorp/terraform-provider-google/blob/main/google/tpgresource/datasource_helpers.go

func FixDatasourceSchemaFlags

func FixDatasourceSchemaFlags(schema map[string]*schema.Schema, required bool, keys ...string)

FixDatasourceSchemaFlags is a convenience func that toggles the Computed, Optional + Required flags on a schema element. This is useful when the schema has been generated (using `datasourceSchemaFromResourceSchema` above for example) and therefore the attribute flags were not set appropriately when first added to the schema definition. Currently only supports top-level schema elements.

code imported from Google's terraform provider. source: https://github.com/hashicorp/terraform-provider-google/blob/main/google/tpgresource/datasource_helpers.go

func NewRegionalID

func NewRegionalID(idI interface{}, fallBackRegion scw.Region) string

func NewZonedID

func NewZonedID(idI interface{}, fallBackZone scw.Zone) string

func SchemaFromResourceSchema

func SchemaFromResourceSchema(rs map[string]*schema.Schema) map[string]*schema.Schema

SchemaFromResourceSchema is a recursive func that converts an existing Resource schema to a Datasource schema. All schema elements are copied, but certain attributes are ignored or changed: - all attributes have Computed = true - all attributes have ForceNew, Required = false - Validation funcs and attributes (e.g. MaxItems) are not copied

code imported from Google's terraform provider. source: https://github.com/hashicorp/terraform-provider-google/blob/main/google/tpgresource/datasource_helpers.go

Types

This section is empty.

Jump to

Keyboard shortcuts

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