types
pyvider.hcl.factories.types
¶
HCL type string parsing for Terraform type syntax.
Classes¶
HclTypeParsingError
¶
Bases: ValueError
Custom exception for errors during HCL type string parsing.
Functions¶
parse_hcl_type_string
¶
Parse HCL type string into CTY type.
Supports: - Primitives: string, number, bool, any - Lists: list(element_type) - Maps: map(element_type) - Objects: object({attr=type, ...})
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_str
|
str
|
HCL type string (e.g., "list(string)", "object({name=string})") |
required |
Returns:
| Type | Description |
|---|---|
CtyType[Any]
|
Corresponding CTY type |
Raises:
| Type | Description |
|---|---|
HclTypeParsingError
|
If type string is malformed |
Example
parse_hcl_type_string("list(string)") CtyList(element_type=CtyString())