Documentation ¶
Index ¶
- Constants
- type Action
- type BuildInput
- type Instruction
- type InvokeOptions
- type Mixin
- func (m *Mixin) Build(ctx context.Context) error
- func (m *Mixin) GetMixinUserAgent() string
- func (m *Mixin) Init(ctx context.Context, backendConfig map[string]interface{}) error
- func (m *Mixin) Install(ctx context.Context) error
- func (m *Mixin) Invoke(ctx context.Context, opts InvokeOptions) error
- func (m *Mixin) PrintSchema()
- func (m *Mixin) PrintVersion(opts version.Options) error
- func (m *Mixin) SetUserAgent()
- func (m *Mixin) Uninstall(ctx context.Context) error
- func (m *Mixin) Upgrade(ctx context.Context) error
- func (m *Mixin) Version() mixin.Metadata
- type MixinConfig
- type Output
- type Step
- type TestMixin
- type TofuFields
Constants ¶
const ( // AzureUserAgentEnvVar is the environment variable used by the azure provider to set // the user agent string sent to Azure. AzureUserAgentEnvVar = "AZURE_HTTP_USER_AGENT" // UserAgentOptOutEnvVar is the name of the environment variable that disables // user agent reporting. UserAgentOptOutEnvVar = "PORTER_OPENTOFU_MIXIN_USER_AGENT_OPT_OUT" )
const ( // DefaultWorkingDir is the default working directory for Opentofu. DefaultWorkingDir = "terraform" // DefaultClientVersion is the default version of the opentofu cli. DefaultClientVersion = "1.2.9" // DefaultInitFile is the default file used to initialize opentofu providers during build. DefaultInitFile = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Name string Steps []Step // using UnmarshalYAML so that we don't need a custom type per action }
func (Action) GetSteps ¶
func (a Action) GetSteps() []builder.ExecutableStep
func (Action) MakeSteps ¶
func (a Action) MakeSteps() interface{}
MakeSteps builds a slice of Steps for data to be unmarshaled into.
func (*Action) UnmarshalYAML ¶
UnmarshalYAML takes any yaml in this form ACTION: - opentofu: ... and puts the steps into the Action.Steps field
type BuildInput ¶
type BuildInput struct {
Config *MixinConfig
}
BuildInput represents stdin passed to the mixin for the build command.
type Instruction ¶
type InvokeOptions ¶
type InvokeOptions struct {
Action string
}
type Mixin ¶
type Mixin struct { runtime.RuntimeConfig // contains filtered or unexported fields }
Mixin is the logic behind the opentofu mixin
func NewFor ¶
func NewFor(cfg runtime.RuntimeConfig) *Mixin
func (*Mixin) GetMixinUserAgent ¶
GetMixinUserAgent returns the portion of the user agent string for the mixin.
func (*Mixin) Invoke ¶
func (m *Mixin) Invoke(ctx context.Context, opts InvokeOptions) error
Invoke runs a custom opentofu action
func (*Mixin) PrintSchema ¶
func (m *Mixin) PrintSchema()
func (*Mixin) SetUserAgent ¶
func (m *Mixin) SetUserAgent()
SetUserAgent sets the AZURE_HTTP_USER_AGENT environment variable with the full user agent string, which includes both a portion for porter and the mixin.
type MixinConfig ¶
type MixinConfig struct { // ClientVersion is the version of the tofu CLI to install ClientVersion string `yaml:"clientVersion,omitempty"` // UserAgentOptOut allows a bundle author to opt out from adding porter and the mixin's version to the tofu user agent string. UserAgentOptOut bool `yaml:"userAgentOptOut,omitempty"` InitFile string `yaml:"initFile,omitempty"` WorkingDir string `yaml:"workingDir,omitempty"` }
MixinConfig represents configuration that can be set on the tofu mixin in porter.yaml mixins:
- opentofu: version: v0.0.0
type Output ¶
type Step ¶
type Step struct {
Instruction `yaml:"opentofu"`
}
func (Step) GetArguments ¶
func (Step) GetCommand ¶
func (Step) GetOutputs ¶
func (Step) GetWorkingDir ¶
type TestMixin ¶
type TestMixin struct { *Mixin TestContext *portercontext.TestContext }
func NewTestMixin ¶
NewTestMixin initializes a opentofu mixin, with the output buffered, and an in-memory file system.
type TofuFields ¶
type TofuFields struct { Vars map[string]interface{} `yaml:"vars,omitempty"` DisableVarFile bool `yaml:"disableVarFile,omitempty"` LogLevel string `yaml:"logLevel,omitempty"` BackendConfig map[string]interface{} `yaml:"backendConfig,omitempty"` }
TofuFields represent fields specific to tofu