mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-27 11:00:18 -04:00
* Implementation of structured logging. These are the changes that enable the cloud backend to consume structured logs and make use of the new plan renderer. This will enable CLI-driven runs to view the structured output in the Terraform Cloud UI. * Cloud structured logging unit tests * Remove deferred logs logic, fix minor issues Color formatting fixes, log type stop lists, default behavior for logs that are unknown * Use service disco path in redacted plan url
28 lines
597 B
Go
28 lines
597 B
Go
package cloud
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/internal/backend"
|
|
"github.com/hashicorp/terraform/internal/command/jsonformat"
|
|
)
|
|
|
|
// CLIInit implements backend.CLI
|
|
func (b *Cloud) CLIInit(opts *backend.CLIOpts) error {
|
|
if cli, ok := b.local.(backend.CLI); ok {
|
|
if err := cli.CLIInit(opts); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
b.CLI = opts.CLI
|
|
b.CLIColor = opts.CLIColor
|
|
b.ContextOpts = opts.ContextOpts
|
|
b.runningInAutomation = opts.RunningInAutomation
|
|
b.input = opts.Input
|
|
b.renderer = &jsonformat.Renderer{
|
|
Streams: opts.Streams,
|
|
Colorize: opts.CLIColor,
|
|
}
|
|
|
|
return nil
|
|
}
|