tfjson

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchemaTypeObject is the custom schema.ValueType used for
	// distinguishing FW nested attribute types
	SchemaTypeObject = schemav2.ValueType(9)
	// SchemaTypeDynamic is the custom schema.ValueType used for
	// distinguishing dynamic-pseudo value types
	SchemaTypeDynamic = schemav2.ValueType(10)
)

NOTE: these are custom workaround additions to the terraform SDK schema.ValueType to support generating TF plugin framework nested attribute and dynamic pseudo-types. Those are not utilized during runtime, just for facilitating CRD generation. https://github.com/hashicorp/terraform-plugin-sdk/blob/42d3ce13b57d6e3696687d59c39f31f07edf6c79/helper/schema/valuetype.go#L14 TODO: remove these when we generate the types directly from JSON schema or framework schemas

Variables

This section is empty.

Functions

func GetV2ResourceMap

func GetV2ResourceMap(resourceSchemas map[string]*tfjson.Schema) map[string]*schemav2.Resource

GetV2ResourceMap converts input resource schemas with "terraform-json" representation to terraform-plugin-sdk representation which is what Upjet expects today.

What we are trying to achieve here is to convert a lower level representation of resource schema map, e.g. output of `terraform providers schema -json` to plugin sdk representation. This is mostly the opposite of what the following method is doing: https://github.com/hashicorp/terraform-plugin-sdk/blob/7e0a333644f1971a936995677b7a106140a0659f/helper/schema/core_schema.go#L43

Ideally, we should not rely on plugin SDK types in Upjet at all but only work with types in https://github.com/hashicorp/terraform-json which is there exactly for this purpose, an external representation of Terraform schemas. This conversion aims to be an intermediate step for that ultimate goal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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