Files
opentf/internal/command/jsonformat/computed/renderers/write_only.go
Andrei Ciobanu 7f76707dd0 Ephemeral write only attributes (#3171)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-09-10 07:45:23 -04:00

25 lines
620 B
Go

// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package renderers
import (
"fmt"
"github.com/opentofu/opentofu/internal/command/jsonformat/computed"
)
func WriteOnly() computed.DiffRenderer {
return &writeOnlyRenderer{}
}
type writeOnlyRenderer struct {
NoWarningsRenderer
}
func (renderer writeOnlyRenderer) RenderHuman(diff computed.Diff, _ int, opts computed.RenderHumanOpts) string {
return fmt.Sprintf("(write-only attribute)%s%s", forcesReplacement(diff.Replace, opts), nullSuffix(diff.Action, opts))
}