codegen

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter struct {
	CfResource *cfschema.Resource
	Ui         cli.Ui
	Writer     io.Writer
}

func (Emitter) EmitResourceSchemaRequiredAttributesValidator

func (e Emitter) EmitResourceSchemaRequiredAttributesValidator() error

EmitResourceSchemaRequiredAttributesValidator generates any resource schema-level required Attributes validators.

func (Emitter) EmitRootPropertiesSchema

func (e Emitter) EmitRootPropertiesSchema(attributeNameMap map[string]string, computedOnly bool) (Features, error)

EmitRootPropertiesSchema generates the Terraform Plugin SDK code for a CloudFormation root schema and emits the generated code to the emitter's Writer. Code features are returned. The root schema is the map of root property names to Attributes. To generate all code features as "Computed", e.g. to be used in a singular data source, set the computedOnly argument to true.

type Features

type Features int

Features of the emitted code.

const (
	HasUpdatableProperty      Features = 1 << iota // At least one property can be updated.
	HasRequiredRootProperty                        // At least one root property is required.
	UsesFrameworkAttr                              // Uses a type from the terraform-plugin-framework/attr package.
	UsesRegexpInValidation                         // Uses a type from the Go standard regexp package for attribute validation.
	UsesValidation                                 // Uses a type or function from the internal/validate package.
	HasIDRootProperty                              // Has a root property named "id"
	HasFrameworkPlanModifiers                      // Has any Attribute PlanModifiers implemented in terraform-plugin-framework/resource.
)

Jump to

Keyboard shortcuts

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