overridecreate

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Field = "override_create"

Field is the Terraform field name which, if included in a schema, will enable override_create handling.

Variables

View Source
var (
	ErrExistsOutsideTerraform = errors.New("entity already exists on server and is not managed in " +
		"terraform state. set the override_create property to import it or this request will fail")
	ErrDoesNotExistOutsideTerraform = errors.New("override_create set to import_or_fail. no resource present " +
		"to import from server")
)

Functions

func CustomizeDiff

func CustomizeDiff(
	resourceIDField string,
	existsOnServer existsOnServerFunc,
	additionalLogFields ...string,
) func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error

CustomizeDiff defines custom diffs for resources using the override_create property to encourage proper use of singleton resources in TF. `additionalLogFields` can optionally be supplied to output additional resource-specific fields in logs triggered by this operation - minimally, the values of `override_create` and the provided resourceIDField will always be included in logs, even if no additional fields are specified with this parameter.

func Schema

func Schema() *schema.Schema

Schema returns the Terraform schema of the OverrideCreate field.

Types

type Action

type Action int

Action indicates what create action to take.

const (
	AlwaysCreate Action = iota + 1
	ImportIfExists
	ImportOrFail
)

func ParseAction

func ParseAction(input string) (Action, error)

func (Action) String

func (a Action) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL