tfresource

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const UniqueIDSuffixLength = 26

UniqueIDSuffixLength is the string length of the suffix generated by PrefixedUniqueId. This can be used by length validation functions to ensure prefixes are the correct length for the target field.

View Source
const UniqueIdPrefix = `terraform-`

Variables

This section is empty.

Functions

func NotFound

func NotFound(err error) bool

NotFound returns true if the error represents a "resource not found" condition. Specifically, NotFound returns true if the error or a wrapped error is of type resource.NotFoundError.

func PrefixedUniqueId

func PrefixedUniqueId(prefix string) string

Helper for a resource to generate a unique identifier w/ given prefix

After the prefix, the ID consists of an incrementing 26 digit value (to match previous timestamp output). After the prefix, the ID consists of a timestamp and an incrementing 8 hex digit value The timestamp means that multiple IDs created with the same prefix will sort in the order of their creation, even across multiple terraform executions, as long as the clock is not turned back between calls, and as long as any given terraform execution generates fewer than 4 billion IDs.

func UniqueId

func UniqueId() string

Helper for a resource to generate a unique identifier w/ default prefix

Types

type NotFoundError

type NotFoundError struct {
	LastError error
	Message   string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

Jump to

Keyboard shortcuts

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