Documentation
¶
Index ¶
- Constants
- Variables
- func NewTemplate(name string) *template.Template
- func ParentStderr() *os.File
- func Provider() terraform.ResourceProvider
- func RandomSafeString(length int) string
- func RandomString(length int) string
- func RandomStringWithCharset(length int, charset string) string
- type ChangeMap
- type Closable
- type CommandTemplates
- type CommandsConfig
- type EnvironmentChangeMap
- type EnvironmentConfig
- type JsonContext
- type KVEntry
- type LoggedOutput
- type Logger
- type Logging
- type OutputConfig
- type ProviderConfig
- type ResourceConfig
- type ResourceData
- func (d *ResourceData) Get(key string) interface{}
- func (d *ResourceData) GetChange(key string) (interface{}, interface{})
- func (d *ResourceData) GetChangedKeysPrefix(prefix string) []string
- func (d *ResourceData) GetOk(key string) (interface{}, bool)
- func (d *ResourceData) GetOld(key string) interface{}
- func (d *ResourceData) GetRollbackKeys() []string
- func (d *ResourceData) HasChangedKeysPrefix(prefix string) bool
- func (d *ResourceData) IsNew() bool
- func (d *ResourceData) Set(key string, value interface{}) (err error)
- func (d *ResourceData) SetIdErr(value string) error
- type ResourceDiff
- func (rd *ResourceDiff) GetChange(key string) (o interface{}, n interface{})
- func (rd *ResourceDiff) GetChangedKeysPrefix(prefix string) []string
- func (rd *ResourceDiff) GetOld(key string) interface{}
- func (rd *ResourceDiff) GetRollbackKeys() []string
- func (rd *ResourceDiff) HasChange(key string) bool
- func (rd *ResourceDiff) HasChangedKeysPrefix(prefix string) bool
- func (rd *ResourceDiff) IsNew() bool
- func (rd *ResourceDiff) Set(key string, value interface{}) error
- func (rd *ResourceDiff) SetIdErr(string) error
- type ResourceInterface
- type Scripted
- type TemplateArg
- type TemplateContext
- type TemplatesConfig
- type TerraformOperation
Constants ¶
View Source
const ( CommandId string = "commands_id" CommandDependencies string = "commands_dependencies" CommandNeedsUpdate string = "commands_needs_update" CommandCustomizeDiffComputeKeys string = "commands_customizediff_computekeys" CommandCreate string = "commands_create" CommandDelete string = "commands_delete" CommandExists string = "commands_exists" CommandRead string = "commands_read" CommandUpdate string = "commands_update" )
View Source
const DefaultEmptyString = `ZVaXr3jCd80vqJRhBP9t83LrpWIdNKWJ`
noinspection SpellCheckingInspection
View Source
const DefaultEnvPrefix = "TF_SCRIPTED_"
View Source
const DefaultLinePrefix = `QmGRizGk1fdPEBVVZSGkCRPJRgAe9p07B`
noinspection SpellCheckingInspection
View Source
const DefaultStatePrefix = `WViRV1TbGAGehAYFL8g3ZL8o1cg1bxaq`
noinspection SpellCheckingInspection
View Source
const DefaultTriggerString = `ndn4VFxYG489bUmV6xKjKFE0RYQIJdts`
noinspection SpellCheckingInspection
View Source
const JsonContextEnvKey = "TF_SCRIPTED_CONTEXT"
View Source
const MaxUint64 = ^uint64(0)
View Source
const TriggerStringTpl = `{{ .TriggerString }}`
View Source
const Version = version.Version
Variables ¶
View Source
var AllowedCommands = map[string]bool{ CommandId: true, CommandDependencies: true, CommandNeedsUpdate: true, CommandCustomizeDiffComputeKeys: true, CommandCreate: true, CommandDelete: true, CommandExists: true, CommandRead: true, CommandUpdate: true, }
View Source
var Debug = getEnvBool("DEBUG", false)
View Source
var DefaultInterpreter = []string{"bash", "-Eeuo", "pipefail", "-c", "{{ .command }}"}
noinspection SpellCheckingInspection
View Source
var DefaultWindowsInterpreter = []string{"cmd", "/C", "{{ .command }}"}
View Source
var EnvEmptyString = getEnvMust("EMPTY_STRING", DefaultEmptyString)
String representing empty value, can be set to anything
View Source
var EnvPrefix = envDefault("TF_SCRIPTED_ENV_PREFIX", DefaultEnvPrefix)
View Source
var ExtraTemplateFuncs = template.FuncMap{ "toYaml": toYaml, "fromYaml": fromYaml, "toJson": toJson, "toPrettyJson": toPrettyJson, "fromJson": fromJson, "is": is, "isSet": isSet, "isFilled": isFilled, "terraformifyValues": terraformifyPrimitives, "include": func(string, interface{}) string { return "not implemented" }, "required": func(string, interface{}) interface{} { return "not implemented" }, }
View Source
var SprigTemplateFuncs = getSprigTemplateFuncs()
View Source
var Stderr = os.Stderr
View Source
var Stdout = os.Stdout
noinspection GoUnusedGlobalVariable
View Source
var TemplateFuncs = getTemplateFuncs()
View Source
var ValidLogLevelsStrings = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"}
Functions ¶
func NewTemplate ¶
func ParentStderr ¶
func Provider ¶
func Provider() terraform.ResourceProvider
func RandomSafeString ¶
noinspection GoUnusedExportedFunction
func RandomStringWithCharset ¶
Types ¶
type CommandTemplates ¶
type CommandsConfig ¶
type CommandsConfig struct { Environment *EnvironmentConfig Templates *CommandTemplates Output *OutputConfig DeleteOnNotExists bool DeleteOnReadFailure bool Separator string WorkingDirectory string TriggerString string InterpreterIsProvider bool InterpreterProviderCommands []string DependenciesNotMetError bool }
type EnvironmentChangeMap ¶
type EnvironmentConfig ¶
type JsonContext ¶
type JsonContext struct {
// contains filtered or unexported fields
}
type LoggedOutput ¶
type LoggedOutput struct {
// contains filtered or unexported fields
}
func (*LoggedOutput) Close ¶
func (lo *LoggedOutput) Close() error
func (*LoggedOutput) Start ¶
func (lo *LoggedOutput) Start() *io.PipeWriter
type OutputConfig ¶
type ProviderConfig ¶
type ProviderConfig struct { Commands *CommandsConfig StateComputeKeys []string OutputComputeKeys []string Templates *TemplatesConfig RunningMessageInterval float64 EmptyString string LoggingBufferSize int64 OutputUseDefaultLinePrefix bool OutputLinePrefix string OutputFormat string StateFormat string StateLinePrefix string LinePrefix string Version string InstanceState *terraform.InstanceState EnvPrefix string OpenParentStderr bool // contains filtered or unexported fields }
type ResourceConfig ¶
type ResourceConfig struct { Context *ChangeMap // contains filtered or unexported fields }
type ResourceData ¶
type ResourceData struct {
*schema.ResourceData
}
func (*ResourceData) Get ¶
func (d *ResourceData) Get(key string) interface{}
func (*ResourceData) GetChange ¶
func (d *ResourceData) GetChange(key string) (interface{}, interface{})
func (*ResourceData) GetChangedKeysPrefix ¶
func (d *ResourceData) GetChangedKeysPrefix(prefix string) []string
func (*ResourceData) GetOk ¶
func (d *ResourceData) GetOk(key string) (interface{}, bool)
func (*ResourceData) GetOld ¶
func (d *ResourceData) GetOld(key string) interface{}
func (*ResourceData) GetRollbackKeys ¶
func (d *ResourceData) GetRollbackKeys() []string
func (*ResourceData) HasChangedKeysPrefix ¶
func (d *ResourceData) HasChangedKeysPrefix(prefix string) bool
func (*ResourceData) IsNew ¶
func (d *ResourceData) IsNew() bool
func (*ResourceData) Set ¶
func (d *ResourceData) Set(key string, value interface{}) (err error)
func (*ResourceData) SetIdErr ¶
func (d *ResourceData) SetIdErr(value string) error
type ResourceDiff ¶
type ResourceDiff struct {
*schema.ResourceDiff
}
func (*ResourceDiff) GetChange ¶
func (rd *ResourceDiff) GetChange(key string) (o interface{}, n interface{})
func (*ResourceDiff) GetChangedKeysPrefix ¶
func (rd *ResourceDiff) GetChangedKeysPrefix(prefix string) []string
func (*ResourceDiff) GetOld ¶
func (rd *ResourceDiff) GetOld(key string) interface{}
func (*ResourceDiff) GetRollbackKeys ¶
func (rd *ResourceDiff) GetRollbackKeys() []string
func (*ResourceDiff) HasChange ¶
func (rd *ResourceDiff) HasChange(key string) bool
func (*ResourceDiff) HasChangedKeysPrefix ¶
func (rd *ResourceDiff) HasChangedKeysPrefix(prefix string) bool
func (*ResourceDiff) IsNew ¶
func (rd *ResourceDiff) IsNew() bool
func (*ResourceDiff) Set ¶
func (rd *ResourceDiff) Set(key string, value interface{}) error
func (*ResourceDiff) SetIdErr ¶
func (rd *ResourceDiff) SetIdErr(string) error
type ResourceInterface ¶
type ResourceInterface interface { GetChange(string) (interface{}, interface{}) Get(string) interface{} GetOld(string) interface{} GetOk(string) (interface{}, bool) Set(string, interface{}) error Id() string IsNew() bool SetIdErr(string) error GetChangedKeysPrefix(string) []string GetRollbackKeys() []string HasChangedKeysPrefix(string) bool HasChange(string) bool }
func WrapResourceData ¶
func WrapResourceData(data *schema.ResourceData) ResourceInterface
func WrapResourceDiff ¶
func WrapResourceDiff(diff *schema.ResourceDiff) ResourceInterface
type Scripted ¶
type Scripted struct {
// contains filtered or unexported fields
}
func New ¶
func New(d ResourceInterface, meta interface{}, operation TerraformOperation, old bool) (*Scripted, error)
func (*Scripted) Environment ¶
func (s *Scripted) Environment() (*EnvironmentChangeMap, error)
type TemplateArg ¶
type TemplateArg struct {
// contains filtered or unexported fields
}
type TemplateContext ¶
type TemplatesConfig ¶
type TerraformOperation ¶
type TerraformOperation string
const ( OperationCreate TerraformOperation = "create" OperationRead TerraformOperation = "read" OperationExists TerraformOperation = "exists" OperationUpdate TerraformOperation = "update" OperationDelete TerraformOperation = "delete" OperationCustomizeDiff TerraformOperation = "customizediff" )
Click to show internal directories.
Click to hide internal directories.