Documentation ¶
Overview ¶
Package gen contains routines for generating a Jsonnet library given a Terraform provider schema.
Index ¶
Constants ¶
const ( IsListOrSet collectionType = iota IsMap IsNotCollection )
const ( IsUnknown resourceOrDataSource = iota IsProvider IsResource IsDataSource IsNestedBlock )
Variables ¶
This section is empty.
Functions ¶
func ProviderNameFromAddr ¶
func RenderLibrary ¶
func RenderLibrary( logger *zap.SugaredLogger, outDir string, opts RenderLibraryOpts, ) error
RenderLibrary renders a full provider schema as a libsonnet library. The libsonnet library has the following folderstructure:
- `main.libsonnet`: The root index file containing all the definitions. - `_gen`: Folder containing all the autogenerated files. - `_gen/main.libsonnet`: The index file containing all the autogenerated definitions. - `_gen/resource_RESOURCE.libsonnet`: A resource object file containing definitions for constructing the given resource block. - `_gen/data_DATASRC.libsonnet`: A data source object file containing definitions for constructing the given data source block.
Types ¶
type RenderLibraryOpts ¶ added in v0.0.2
type RenderLibraryOpts struct { ProviderName string ResourcePrefix string Schema *tfjson.ProviderSchema }