Documentation ¶
Overview ¶
hclwrite is a shared interface for writing HCL files for cross-tests. Both the Terraform Plugin SDK bridge and the Pulumi Framework bridge implement this interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteProvider ¶
func WriteProvider(w io.Writer, schema ShimHCLSchema, providerType string, config map[string]cty.Value) error
WriteProvider writes a provider declaration to an HCL file.
Note that unknowns are not yet supported in cty.Value, it will error out if found.
func WriteResource ¶
func WriteResource( w io.Writer, schema ShimHCLSchema, resourceType, resourceName string, config map[string]cty.Value, opts ...WriteResourceOption, ) error
WriteResource writes a resource declaration to an HCL file.
Note that unknowns are not yet supported in cty.Value, it will error out if found.
Types ¶
type ShimHCLAttribute ¶
type ShimHCLAttribute struct{}
ShimHCLAttribute is an attribute used to write a value to an HCL file.
type ShimHCLBlock ¶
type ShimHCLBlock interface { GetNestingMode() Nesting GetAttributes() map[string]ShimHCLAttribute GetBlocks() map[string]ShimHCLBlock }
ShimHCLBlock is a block used to write a value to an HCL file.
type ShimHCLSchema ¶
type ShimHCLSchema interface { GetAttributes() map[string]ShimHCLAttribute GetBlocks() map[string]ShimHCLBlock }
ShimHCLSchema is the schema used to write a value to an HCL file.
type WriteResourceOption ¶
type WriteResourceOption func(*writeResourceOptions)
WriteResourceOption is an option for WriteResource.
func WithCreateBeforeDestroy ¶
func WithCreateBeforeDestroy(createBeforeDestroy bool) WriteResourceOption
WithCreateBeforeDestroy is an option to set the create_before_destroy attribute on a resource.