Documentation ¶
Index ¶
- func SortLiterals(v []*Literal)
- type Literal
- func LiteralBinaryExpression(lhs *Literal, operator string, rhs *Literal) *Literal
- func LiteralData(dataSourceType, dataSourceName, prop string) *Literal
- func LiteralEmptyStrConditionalExpression(empty, value *Literal) *Literal
- func LiteralFromIntValue[T constraints.Integer](i T) *Literal
- func LiteralFromStringValue(s string) *Literal
- func LiteralFunctionExpression(functionName string, args ...*Literal) *Literal
- func LiteralIndexExpression(collection *Literal, index *Literal) *Literal
- func LiteralListExpression(args ...*Literal) *Literal
- func LiteralProperty(resourceType, resourceName, prop string) *Literal
- func LiteralSelfLink(resourceType, resourceName string) *Literal
- func LiteralTokens(tokens ...string) *Literal
- func LiteralWithIndex(s string) *Literal
- type OutputValue
- type TerraformProvider
- type TerraformWriter
- func (t *TerraformWriter) AddFileBytes(resourceType string, resourceName string, key string, data []byte, base64 bool) (*Literal, error)
- func (t *TerraformWriter) AddFilePath(resourceType string, resourceName string, key string, data []byte, base64 bool) (*Literal, error)
- func (t *TerraformWriter) AddOutputVariable(key string, literal *Literal) error
- func (t *TerraformWriter) AddOutputVariableArray(key string, literal *Literal) error
- func (t *TerraformWriter) EnsureTerraformProvider(name string, arguments map[string]string) *TerraformProvider
- func (t *TerraformWriter) GetDataSourcesByType() (map[string]map[string]interface{}, error)
- func (t *TerraformWriter) GetOutputs() (map[string]OutputValue, error)
- func (t *TerraformWriter) GetResourcesByType() (map[string]map[string]interface{}, error)
- func (t *TerraformWriter) InitTerraformWriter()
- func (t *TerraformWriter) RenderDataSource(dataType string, dataName string, e interface{}) error
- func (t *TerraformWriter) RenderResource(resourceType string, resourceName string, e interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortLiterals ¶
func SortLiterals(v []*Literal)
SortLiterals sorts a list of Literal, by key. It does so in-place
Types ¶
type Literal ¶
type Literal struct { // String is the Terraform representation. String string `cty:"string"` }
Literal represents a literal in terraform syntax
func LiteralBinaryExpression ¶ added in v1.26.0
LiteralBinaryExpression constructs a Literal with the result of a binary operator expression. It is the caller's responsibility to ensure the supplied parameters do not use operators with lower precedence than the supplied operator.
func LiteralData ¶ added in v1.26.0
func LiteralEmptyStrConditionalExpression ¶ added in v1.26.3
LiteralEmptyStrConditionalExpression constructs a Literal which returns `null` if the supplied "empty" expression is an empty string, otherwise returns "value". It is the caller's responsibility to ensure the supplied parameters do not use operators with lower precedence than the conditional operator.
func LiteralFromIntValue ¶ added in v1.26.0
func LiteralFromIntValue[T constraints.Integer](i T) *Literal
func LiteralFromStringValue ¶
func LiteralFunctionExpression ¶ added in v1.21.3
LiteralFunctionExpression constructs a Literal representing the result of calling the supplied functionName with the supplied args.
func LiteralIndexExpression ¶ added in v1.26.0
LiteralIndexExpression constructs a Literal with the result of accessing the supplied collection using the supplied index. It is the caller's responsibility to ensure the supplied collection does not use operators with lower precedence than the index operator.
func LiteralListExpression ¶ added in v1.26.0
LiteralListExpression constructs a Literal consisting of a list of supplied Literals.
func LiteralProperty ¶
func LiteralSelfLink ¶
func LiteralTokens ¶ added in v1.21.3
func LiteralWithIndex ¶ added in v1.25.0
func (*Literal) IsSingleValue ¶ added in v1.26.0
func (*Literal) MarshalJSON ¶
type OutputValue ¶
type TerraformProvider ¶ added in v1.27.0
type TerraformProvider struct { // Name is the name of the terraform provider Name string // Arguments are additional settings used in the provider definition Arguments map[string]string }
TerraformProvider is a provider definition for a terraform file written to cloud storage (S3, GCS, etc)
type TerraformWriter ¶
type TerraformWriter struct { // Providers is a list of TF Providers we need for writing files Providers map[string]*TerraformProvider // Files is a map of TF resource Files that should be created Files map[string][]byte // contains filtered or unexported fields }
func (*TerraformWriter) AddFileBytes ¶
func (*TerraformWriter) AddFilePath ¶ added in v1.26.0
func (*TerraformWriter) AddOutputVariable ¶
func (t *TerraformWriter) AddOutputVariable(key string, literal *Literal) error
func (*TerraformWriter) AddOutputVariableArray ¶
func (t *TerraformWriter) AddOutputVariableArray(key string, literal *Literal) error
func (*TerraformWriter) EnsureTerraformProvider ¶ added in v1.27.0
func (t *TerraformWriter) EnsureTerraformProvider(name string, arguments map[string]string) *TerraformProvider
func (*TerraformWriter) GetDataSourcesByType ¶ added in v1.26.0
func (t *TerraformWriter) GetDataSourcesByType() (map[string]map[string]interface{}, error)
func (*TerraformWriter) GetOutputs ¶
func (t *TerraformWriter) GetOutputs() (map[string]OutputValue, error)
func (*TerraformWriter) GetResourcesByType ¶
func (t *TerraformWriter) GetResourcesByType() (map[string]map[string]interface{}, error)
func (*TerraformWriter) InitTerraformWriter ¶
func (t *TerraformWriter) InitTerraformWriter()
func (*TerraformWriter) RenderDataSource ¶ added in v1.26.0
func (t *TerraformWriter) RenderDataSource(dataType string, dataName string, e interface{}) error
func (*TerraformWriter) RenderResource ¶
func (t *TerraformWriter) RenderResource(resourceType string, resourceName string, e interface{}) error