Documentation ¶
Index ¶
- Constants
- Variables
- func FromResourcePropertyValue(v PropertyValue) property.Value
- func HasSig(obj PropertyMap, match string) bool
- func IDStrings(ids []ID) []string
- func IsInternalPropertyKey(key PropertyKey) bool
- func IsReqError(err error) bool
- func NewErrors(errs []error) error
- func NewPropertyError(typ string, property string, err error) error
- func NewUniqueHex(prefix string, randlen, maxlen int) (string, error)
- func NewUniqueName(randomSeed []byte, prefix string, randlen, maxlen int, charset []rune) (string, error)
- type Alias
- type Archive
- func DeserializeArchive(obj map[string]interface{}) (*Archive, bool, error)
- func NewAssetArchive(assets map[string]interface{}) (*Archive, error)
- func NewAssetArchiveWithWD(assets map[string]interface{}, wd string) (*Archive, error)
- func NewPathArchive(path string) (*Archive, error)
- func NewPathArchiveWithWD(path string, wd string) (*Archive, error)
- func NewURIArchive(uri string) (*Archive, error)
- type ArchiveFormat
- type ArrayDiff
- type Asset
- type Blob
- type Computed
- type CustomTimeouts
- type Goal
- type ID
- type IgnoreKeyFunc
- type ObjectDiff
- func (diff *ObjectDiff) Added(k PropertyKey) bool
- func (diff *ObjectDiff) AnyChanges() bool
- func (diff *ObjectDiff) Changed(k PropertyKey) bool
- func (diff *ObjectDiff) ChangedKeys() []PropertyKey
- func (diff *ObjectDiff) Deleted(k PropertyKey) bool
- func (diff *ObjectDiff) Keys() []PropertyKey
- func (diff *ObjectDiff) Same(k PropertyKey) bool
- func (diff *ObjectDiff) Updated(k PropertyKey) bool
- type Operation
- type OperationType
- type Output
- type Property
- type PropertyKey
- type PropertyMap
- func NewPropertyMap(s interface{}) PropertyMap
- func NewPropertyMapFromMap(m map[string]interface{}) PropertyMap
- func NewPropertyMapFromMapRepl(m map[string]interface{}, replk func(string) (PropertyKey, bool), ...) PropertyMap
- func NewPropertyMapRepl(s interface{}, replk func(string) (PropertyKey, bool), ...) PropertyMap
- func (props PropertyMap) ContainsSecrets() bool
- func (props PropertyMap) ContainsUnknowns() bool
- func (props PropertyMap) Copy() PropertyMap
- func (props PropertyMap) DeepEquals(other PropertyMap) bool
- func (props PropertyMap) DeepEqualsIncludeUnknowns(other PropertyMap) bool
- func (props PropertyMap) Diff(other PropertyMap, ignoreKeys ...IgnoreKeyFunc) *ObjectDiff
- func (props PropertyMap) DiffIncludeUnknowns(other PropertyMap, ignoreKeys ...IgnoreKeyFunc) *ObjectDiff
- func (props PropertyMap) HasValue(k PropertyKey) bool
- func (props PropertyMap) MapRepl(replk func(string) (string, bool), ...) map[string]interface{}
- func (props PropertyMap) Mappable() map[string]interface{}
- func (props PropertyMap) StableKeys() []PropertyKey
- type PropertyPath
- func (p PropertyPath) Add(dest, v PropertyValue) (PropertyValue, bool)
- func (p PropertyPath) Contains(other PropertyPath) bool
- func (p PropertyPath) Delete(dest PropertyValue) bool
- func (p PropertyPath) Get(v PropertyValue) (PropertyValue, bool)
- func (p PropertyPath) Reset(old, new PropertyMap) bool
- func (p PropertyPath) Set(dest, v PropertyValue) bool
- func (p PropertyPath) String() string
- type PropertyValue
- func MakeComponentResourceReference(urn URN, packageVersion string) PropertyValue
- func MakeComputed(v PropertyValue) PropertyValue
- func MakeCustomResourceReference(urn URN, id ID, packageVersion string) PropertyValue
- func MakeOutput(v PropertyValue) PropertyValue
- func MakeSecret(v PropertyValue) PropertyValue
- func NewArchiveProperty(v *archive.Archive) PropertyValue
- func NewArrayProperty(v []PropertyValue) PropertyValue
- func NewAssetProperty(v *asset.Asset) PropertyValue
- func NewBoolProperty(v bool) PropertyValue
- func NewComputedProperty(v Computed) PropertyValue
- func NewNullProperty() PropertyValue
- func NewNumberProperty(v float64) PropertyValue
- func NewObjectProperty(v PropertyMap) PropertyValue
- func NewOutputProperty(v Output) PropertyValue
- func NewProperty[T PropertyValueType](v T) PropertyValue
- func NewPropertyValue(v interface{}) PropertyValue
- func NewPropertyValueRepl(v interface{}, replk func(string) (PropertyKey, bool), ...) PropertyValue
- func NewResourceReferenceProperty(v ResourceReference) PropertyValue
- func NewSecretProperty(v *Secret) PropertyValue
- func NewStringProperty(v string) PropertyValue
- func ToResourcePropertyValue(v property.Value) PropertyValue
- func (v PropertyValue) ArchiveValue() *archive.Archive
- func (v PropertyValue) ArrayValue() []PropertyValue
- func (v PropertyValue) AssetValue() *asset.Asset
- func (v PropertyValue) BoolValue() bool
- func (v PropertyValue) ContainsSecrets() bool
- func (v PropertyValue) ContainsUnknowns() bool
- func (v PropertyValue) DeepEquals(other PropertyValue) bool
- func (v PropertyValue) DeepEqualsIncludeUnknowns(other PropertyValue) bool
- func (v PropertyValue) Diff(other PropertyValue, ignoreKeys ...IgnoreKeyFunc) *ValueDiff
- func (v PropertyValue) DiffIncludeUnknowns(other PropertyValue, ignoreKeys ...IgnoreKeyFunc) *ValueDiff
- func (v PropertyValue) HasValue() bool
- func (v PropertyValue) Input() Computed
- func (v PropertyValue) IsArchive() bool
- func (v PropertyValue) IsArray() bool
- func (v PropertyValue) IsAsset() bool
- func (v PropertyValue) IsBool() bool
- func (v PropertyValue) IsComputed() bool
- func (v PropertyValue) IsNull() bool
- func (v PropertyValue) IsNumber() bool
- func (v PropertyValue) IsObject() bool
- func (v PropertyValue) IsOutput() bool
- func (v PropertyValue) IsResourceReference() bool
- func (v PropertyValue) IsSecret() bool
- func (v PropertyValue) IsString() bool
- func (v PropertyValue) MapRepl(replk func(string) (string, bool), ...) interface{}
- func (v PropertyValue) Mappable() interface{}
- func (v PropertyValue) NumberValue() float64
- func (v PropertyValue) ObjectValue() PropertyMap
- func (v PropertyValue) OutputValue() Output
- func (v PropertyValue) ResourceReferenceValue() ResourceReference
- func (v PropertyValue) SecretValue() *Secret
- func (v PropertyValue) String() string
- func (v PropertyValue) StringValue() string
- func (v PropertyValue) TypeString() string
- type PropertyValueType
- type Reader
- type ReqError
- type ResourceReference
- type Secret
- type State
- type StateDependency
- type StateDependencyType
- type Status
- type URN
- func CreateURN(name string, t string, parent URN, project string, stack string) URN
- func DefaultRootStackURN(stack tokens.QName, proj tokens.PackageName) URN
- func NewURN(stack tokens.QName, proj tokens.PackageName, parentType, baseType tokens.Type, ...) URN
- func ParseOptionalURN(s string) (URN, error)
- func ParseURN(s string) (URN, error)
- type ValueDiff
Constants ¶
const ( AssetSig = asset.AssetSig AssetHashProperty = asset.AssetHashProperty AssetTextProperty = asset.AssetTextProperty AssetPathProperty = asset.AssetPathProperty AssetURIProperty = asset.AssetURIProperty ArchiveSig = archive.ArchiveSig ArchiveHashProperty = archive.ArchiveHashProperty // the dynamic property for an archive's hash. ArchiveAssetsProperty = archive.ArchiveAssetsProperty // the dynamic property for an archive's assets. ArchivePathProperty = archive.ArchivePathProperty // the dynamic property for an archive's path. ArchiveURIProperty = archive.ArchiveURIProperty // the dynamic property for an archive's URI. )
const ( NotArchive = archive.NotArchive // not an archive. TarArchive = archive.TarArchive // a POSIX tar archive. // a POSIX tar archive that has been subsequently compressed using GZip. TarGZIPArchive = archive.TarGZIPArchive ZIPArchive = archive.ZIPArchive // a multi-file ZIP archive. JARArchive = archive.JARArchive // a Java JAR file )
const ( URNPrefix = urn.Prefix // the standard URN prefix URNNamespaceID = urn.NamespaceID // the URN namespace URNNameDelimiter = urn.NameDelimiter // the delimiter between URN name elements URNTypeDelimiter = urn.TypeDelimiter // the delimiter between URN type elements )
const ( // BookkeepingDir is the name of our bookkeeping folder, we store state here (like .git for git). // Copied from workspace.BookkeepingDir to break import cycle. BookkeepingDir = ".pulumi" )
const OutputValueSig = sig.OutputValue
OutputValueSig is the unique output value signature.
const ResourceReferenceSig = sig.ResourceReference
ResourceReferenceSig is the unique resource reference signature.
const RootStackType tokens.Type = tokens.RootStackType
RootStackType is the type name that will be used for the root component in the Pulumi resource tree.
const SecretSig = sig.Secret
SecretSig is the unique secret signature.
const SigKey = sig.Key
SigKey is sometimes used to encode type identity inside of a map. This is required when flattening into ordinary maps, like we do when performing serialization, to ensure recoverability of type identities later on.
Variables ¶
var ArchiveExts = archive.ArchiveExts
ArchiveExts maps from a file extension and its associated archive and/or compression format.
Functions ¶
func FromResourcePropertyValue ¶ added in v3.111.0
func FromResourcePropertyValue(v PropertyValue) property.Value
Translate a PropertyValue into a Value.
This is a normalizing transition, such that the last expression will be true:
normalized := ToResourcePropertyValue(FromResourcePropertyValue(v)) normalized.DeepEquals(ToResourcePropertyValue(FromResourcePropertyValue(v)))
func HasSig ¶
func HasSig(obj PropertyMap, match string) bool
HasSig checks to see if the given property map contains the specific signature match.
func IsInternalPropertyKey ¶
func IsInternalPropertyKey(key PropertyKey) bool
IsInternalPropertyKey returns true if the given property key is an internal key that should not be displayed to users.
func IsReqError ¶
func NewErrors ¶
NewErrors creates a new error list pertaining to a resource. Note that it just turns around and defers to the same mapping infrastructure used for serialization and deserialization, but it presents a nicer interface.
func NewPropertyError ¶
NewPropertyError creates a new error pertaining to a resource's property. Note that it just turns around and defers to the same mapping infrastructure used for serialization and deserialization, but it presents a nicer interface.
func NewUniqueHex ¶
NewUniqueHex generates a new "random" hex string for use by resource providers. It will take the optional prefix and append randlen random characters (defaulting to 8 if not > 0). The result must not exceed maxlen total characterss (if > 0). Note that capping to maxlen necessarily increases the risk of collisions.
func NewUniqueName ¶ added in v3.35.0
func NewUniqueName(randomSeed []byte, prefix string, randlen, maxlen int, charset []rune) (string, error)
NewUniqueName generates a new "random" string primarily intended for use by resource providers for autonames. It will take the optional prefix and append randlen random characters (defaulting to 8 if not > 0). The result must not exceed maxlen total characters (if > 0). The characters that make up the random suffix can be set via charset, and will default to [a-f0-9]. Note that capping to maxlen necessarily increases the risk of collisions. The randomness for this method is a function of randomSeed if given, else it falls back to a non-deterministic source of randomness.
Types ¶
type Alias ¶ added in v3.35.0
type Archive ¶
func DeserializeArchive ¶
DeserializeArchive checks to see if the map contains an archive, using its signature, and if so deserializes it.
func NewAssetArchive ¶
func NewAssetArchiveWithWD ¶ added in v3.122.0
func NewPathArchive ¶
func NewPathArchiveWithWD ¶ added in v3.115.0
func NewURIArchive ¶
type ArchiveFormat ¶
type ArrayDiff ¶
type ArrayDiff struct { Adds map[int]PropertyValue // elements added in the new. Deletes map[int]PropertyValue // elements deleted in the new. Sames map[int]PropertyValue // elements the same in both. Updates map[int]ValueDiff // elements that have changed in the new. }
ArrayDiff holds the results of diffing two arrays of property values.
type Asset ¶
func DeserializeAsset ¶
DeserializeAsset checks to see if the map contains an asset, using its signature, and if so deserializes it.
func NewPathAsset ¶
NewPathAsset produces a new asset and its corresponding SHA256 hash from the given filesystem path.
func NewPathAssetWithWD ¶ added in v3.115.0
NewPathAsset produces a new asset and its corresponding SHA256 hash from the given filesystem path.
func NewTextAsset ¶
NewTextAsset produces a new asset and its corresponding SHA256 hash from the given text.
func NewURIAsset ¶
NewURIAsset produces a new asset and its corresponding SHA256 hash from the given network URI.
type Blob ¶
func NewFileBlob ¶
NewFileBlob creates a new asset blob whose size is known thanks to stat.
func NewReadCloserBlob ¶
func NewReadCloserBlob(r io.ReadCloser) (*Blob, error)
NewReadCloserBlob turn any old ReadCloser into an Blob, usually by making a copy.
type Computed ¶
type Computed struct {
Element PropertyValue // the eventual value (type) of the computed property.
}
Computed represents the absence of a property value, because it will be computed at some point in the future. It contains a property value which represents the underlying expected type of the eventual property value.
type CustomTimeouts ¶
type CustomTimeouts struct { Create float64 `json:"create,omitempty" yaml:"create,omitempty"` Update float64 `json:"update,omitempty" yaml:"update,omitempty"` Delete float64 `json:"delete,omitempty" yaml:"delete,omitempty"` }
func (*CustomTimeouts) IsNotEmpty ¶
func (c *CustomTimeouts) IsNotEmpty() bool
type Goal ¶
type Goal struct { Type tokens.Type // the type of resource. Name string // the name for the resource's URN. Custom bool // true if this resource is custom, managed by a plugin. Properties PropertyMap // the resource's property state. Parent URN // an optional parent URN for this resource. Protect bool // true to protect this resource from deletion. Dependencies []URN // dependencies of this resource object. Provider string // the provider to use for this resource. InitErrors []string // errors encountered as we attempted to initialize the resource. PropertyDependencies map[PropertyKey][]URN // the set of dependencies that affect each property. DeleteBeforeReplace *bool // true if this resource should be deleted prior to replacement. IgnoreChanges []string // a list of property paths to ignore when diffing. AdditionalSecretOutputs []PropertyKey // outputs that should always be treated as secrets. Aliases []Alias // additional structured Aliases that should be assigned. ID ID // the expected ID of the resource, if any. CustomTimeouts CustomTimeouts // an optional config object for resource options ReplaceOnChanges []string // a list of property paths that if changed should force a replacement. // if set to True, the providers Delete method will not be called for this resource. RetainOnDelete bool // if set, the providers Delete method will not be called for this resource // if specified resource is being deleted as well. DeletedWith URN SourcePosition string // If set, the source location of the resource registration }
Goal is a desired state for a resource object. Normally it represents a subset of the resource's state expressed by a program, however if Output is true, it represents a more complete, post-deployment view of the state.
func NewGoal ¶
func NewGoal(t tokens.Type, name string, custom bool, props PropertyMap, parent URN, protect bool, dependencies []URN, provider string, initErrors []string, propertyDependencies map[PropertyKey][]URN, deleteBeforeReplace *bool, ignoreChanges []string, additionalSecretOutputs []PropertyKey, aliases []Alias, id ID, customTimeouts *CustomTimeouts, replaceOnChanges []string, retainOnDelete bool, deletedWith URN, sourcePosition string, ) *Goal
NewGoal allocates a new resource goal state.
type ID ¶
type ID string
ID is a unique resource identifier; it is managed by the provider and is mostly opaque.
func NewUniqueHexID ¶
NewUniqueHexID generates a new "random" hex string for use by resource providers. It will take the optional prefix and append randlen random characters (defaulting to 8 if not > 0). The result must not exceed maxlen total characterss (if > 0). Note that capping to maxlen necessarily increases the risk of collisions.
type IgnoreKeyFunc ¶
type IgnoreKeyFunc func(key PropertyKey) bool
IgnoreKeyFunc is the callback type for Diff's ignore option.
type ObjectDiff ¶
type ObjectDiff struct { Adds PropertyMap // properties in this map are created in the new. Deletes PropertyMap // properties in this map are deleted from the new. Sames PropertyMap // properties in this map are the same. Updates map[PropertyKey]ValueDiff // properties in this map are changed in the new. }
ObjectDiff holds the results of diffing two object property maps.
func (*ObjectDiff) Added ¶
func (diff *ObjectDiff) Added(k PropertyKey) bool
Added returns true if the property 'k' has been added in the new property set.
func (*ObjectDiff) AnyChanges ¶ added in v3.19.0
func (diff *ObjectDiff) AnyChanges() bool
AnyChanges returns true if there are any changes (adds, deletes, updates) in the diff. Otherwise returns false.
func (*ObjectDiff) Changed ¶
func (diff *ObjectDiff) Changed(k PropertyKey) bool
Changed returns true if the property 'k' is known to be different between old and new.
func (*ObjectDiff) ChangedKeys ¶ added in v3.19.0
func (diff *ObjectDiff) ChangedKeys() []PropertyKey
All keys where Changed(k) = true.
func (*ObjectDiff) Deleted ¶
func (diff *ObjectDiff) Deleted(k PropertyKey) bool
Deleted returns true if the property 'k' has been deleted from the new property set.
func (*ObjectDiff) Keys ¶
func (diff *ObjectDiff) Keys() []PropertyKey
Keys returns a stable snapshot of all keys known to this object, across adds, deletes, sames, and updates.
func (*ObjectDiff) Same ¶
func (diff *ObjectDiff) Same(k PropertyKey) bool
Same returns true if the property 'k' is *not* known to be different; note that this isn't the same as looking up in the Sames map, because it is possible the key is simply missing altogether (as is the case for nulls).
func (*ObjectDiff) Updated ¶
func (diff *ObjectDiff) Updated(k PropertyKey) bool
Updated returns true if the property 'k' has been changed between new and old property sets.
type Operation ¶
type Operation struct { Resource *State Type OperationType }
Operation represents an operation that the engine has initiated but has not yet completed. It is essentially just a tuple of a resource and a string identifying the operation.
func NewOperation ¶
func NewOperation(state *State, op OperationType) Operation
NewOperation constructs a new Operation from a state and an operation name.
type OperationType ¶
type OperationType string
OperationType is the type of operations issued by the engine.
const ( // OperationTypeCreating is the state of resources that are being created. OperationTypeCreating OperationType = "creating" // OperationTypeUpdating is the state of resources that are being updated. OperationTypeUpdating OperationType = "updating" // OperationTypeDeleting is the state of resources that are being deleted. OperationTypeDeleting OperationType = "deleting" // OperationTypeReading is the state of resources that are being read. OperationTypeReading OperationType = "reading" // OperationTypeImporting is the state of resources that are being imported. OperationTypeImporting OperationType = "importing" )
type Output ¶
type Output struct { Element PropertyValue // the value of this output if it is resolved. Known bool `json:"-"` // true if this output's value is known. Secret bool `json:"-"` // true if this output's value is secret. Dependencies []URN `json:"-"` // the dependencies associated with this output. }
Output is a property value that will eventually be computed by the resource provider. If an output property is encountered, it means the resource has not yet been created, and so the output value is unavailable. Note that an output property is a special case of computed, but carries additional semantic meaning.
type Property ¶
type Property struct { Key PropertyKey Value PropertyValue }
Property is a pair of key and value.
type PropertyMap ¶
type PropertyMap map[PropertyKey]PropertyValue
PropertyMap is a simple map keyed by property name with "JSON-like" values.
func NewPropertyMap ¶
func NewPropertyMap(s interface{}) PropertyMap
NewPropertyMap turns a struct into a property map, using any JSON tags inside to determine naming.
func NewPropertyMapFromMap ¶
func NewPropertyMapFromMap(m map[string]interface{}) PropertyMap
NewPropertyMapFromMap creates a resource map from a regular weakly typed JSON-like map.
func NewPropertyMapFromMapRepl ¶
func NewPropertyMapFromMapRepl(m map[string]interface{}, replk func(string) (PropertyKey, bool), replv func(interface{}) (PropertyValue, bool), ) PropertyMap
NewPropertyMapFromMapRepl optionally replaces keys/values in an existing map while creating a new resource map.
func NewPropertyMapRepl ¶
func NewPropertyMapRepl(s interface{}, replk func(string) (PropertyKey, bool), replv func(interface{}) (PropertyValue, bool), ) PropertyMap
NewPropertyMapRepl turns a struct into a property map, using any JSON tags inside to determine naming. If non-nil replk or replv function(s) are provided, key and/or value transformations are performed during the mapping.
func (PropertyMap) ContainsSecrets ¶
func (props PropertyMap) ContainsSecrets() bool
ContainsSecrets returns true if the property map contains at least one secret value.
func (PropertyMap) ContainsUnknowns ¶
func (props PropertyMap) ContainsUnknowns() bool
ContainsUnknowns returns true if the property map contains at least one unknown value.
func (PropertyMap) Copy ¶
func (props PropertyMap) Copy() PropertyMap
Copy makes a shallow copy of the map.
func (PropertyMap) DeepEquals ¶
func (props PropertyMap) DeepEquals(other PropertyMap) bool
DeepEquals returns true if this property map is deeply equal to the other property map; and false otherwise.
func (PropertyMap) DeepEqualsIncludeUnknowns ¶ added in v3.24.0
func (props PropertyMap) DeepEqualsIncludeUnknowns(other PropertyMap) bool
func (PropertyMap) Diff ¶
func (props PropertyMap) Diff(other PropertyMap, ignoreKeys ...IgnoreKeyFunc) *ObjectDiff
Diff returns a diffset by comparing the property map to another; it returns nil if there are no diffs.
func (PropertyMap) DiffIncludeUnknowns ¶ added in v3.24.0
func (props PropertyMap) DiffIncludeUnknowns(other PropertyMap, ignoreKeys ...IgnoreKeyFunc) *ObjectDiff
DiffIncludeUnknowns returns a diffset by comparing the property map to another; it returns nil if there are no diffs.
func (PropertyMap) HasValue ¶
func (props PropertyMap) HasValue(k PropertyKey) bool
HasValue returns true if the slot associated with the given property key contains a real value. It returns false if a value is null or an output property that is awaiting a value to be assigned. That is to say, HasValue indicates a semantically meaningful value is present (even if it's a computed one whose concrete value isn't yet evaluated).
func (PropertyMap) MapRepl ¶
func (props PropertyMap) MapRepl(replk func(string) (string, bool), replv func(PropertyValue) (interface{}, bool), ) map[string]interface{}
MapRepl returns a mapper-compatible object map, suitable for deserialization into structures. A key and/or value replace function, replk/replv, may be passed that will replace elements using custom logic if appropriate.
func (PropertyMap) Mappable ¶
func (props PropertyMap) Mappable() map[string]interface{}
Mappable returns a mapper-compatible object map, suitable for deserialization into structures.
func (PropertyMap) StableKeys ¶
func (props PropertyMap) StableKeys() []PropertyKey
StableKeys returns all of the map's keys in a stable order.
type PropertyPath ¶
type PropertyPath []interface{}
PropertyPath represents a path to a nested property. The path may be composed of strings (which access properties in ObjectProperty values) and integers (which access elements of ArrayProperty values).
func ParsePropertyPath ¶
func ParsePropertyPath(path string) (PropertyPath, error)
func ParsePropertyPathStrict ¶ added in v3.103.0
func ParsePropertyPathStrict(path string) (PropertyPath, error)
func (PropertyPath) Add ¶
func (p PropertyPath) Add(dest, v PropertyValue) (PropertyValue, bool)
Add sets the location inside a PropertyValue indicated by the PropertyPath to the given value. Any components referred to by the path that do not exist will be created. If there is a mismatch between the type of an existing component and a key that traverses that component, this function will return false. If the destination is a null property value, this function will create and return a new property value.
func (PropertyPath) Contains ¶ added in v3.6.0
func (p PropertyPath) Contains(other PropertyPath) bool
Contains returns true if the receiver property path contains the other property path. For example, the path `foo["bar"][1]` contains the path `foo.bar[1].baz`. The key `"*"` is a wildcard which matches any string or int index at that same nesting level. So for example, the path `foo.*.baz` contains `foo.bar.baz.bam`, and the path `*` contains any path.
func (PropertyPath) Delete ¶
func (p PropertyPath) Delete(dest PropertyValue) bool
Delete attempts to delete the value located by the PropertyPath inside the given PropertyValue. If any component of the path does not exist, this function will return false.
func (PropertyPath) Get ¶
func (p PropertyPath) Get(v PropertyValue) (PropertyValue, bool)
Get attempts to get the value located by the PropertyPath inside the given PropertyValue. If any component of the path does not exist, this function will return (NullPropertyValue, false).
func (PropertyPath) Reset ¶ added in v3.73.0
func (p PropertyPath) Reset(old, new PropertyMap) bool
Reset attempts to reset the values located by the PropertyPath inside the given new PropertyMap to the values from the same location in the old PropertyMap. Reset behaves likes Set in that it will not create intermediate locations, it also won't create or delete array locations (because that would change the size of the array).
func (PropertyPath) Set ¶
func (p PropertyPath) Set(dest, v PropertyValue) bool
Set attempts to set the location inside a PropertyValue indicated by the PropertyPath to the given value. If any component of the path besides the last component does not exist, this function will return false.
func (PropertyPath) String ¶ added in v3.24.0
func (p PropertyPath) String() string
type PropertyValue ¶
type PropertyValue struct {
V interface{}
}
PropertyValue is the value of a property, limited to a select few types (see below).
func MakeComponentResourceReference ¶
func MakeComponentResourceReference(urn URN, packageVersion string) PropertyValue
MakeComponentResourceReference creates a reference to a component resource.
func MakeComputed ¶
func MakeComputed(v PropertyValue) PropertyValue
func MakeCustomResourceReference ¶
func MakeCustomResourceReference(urn URN, id ID, packageVersion string) PropertyValue
MakeCustomResourceReference creates a reference to a custom resource. If the resource's ID is the empty string, it will be treated as unknown.
func MakeOutput ¶
func MakeOutput(v PropertyValue) PropertyValue
func MakeSecret ¶
func MakeSecret(v PropertyValue) PropertyValue
func NewArchiveProperty ¶
func NewArchiveProperty(v *archive.Archive) PropertyValue
func NewArrayProperty ¶
func NewArrayProperty(v []PropertyValue) PropertyValue
func NewAssetProperty ¶
func NewAssetProperty(v *asset.Asset) PropertyValue
func NewBoolProperty ¶
func NewBoolProperty(v bool) PropertyValue
func NewComputedProperty ¶
func NewComputedProperty(v Computed) PropertyValue
func NewNullProperty ¶
func NewNullProperty() PropertyValue
func NewNumberProperty ¶
func NewNumberProperty(v float64) PropertyValue
func NewObjectProperty ¶
func NewObjectProperty(v PropertyMap) PropertyValue
func NewOutputProperty ¶
func NewOutputProperty(v Output) PropertyValue
func NewProperty ¶ added in v3.94.0
func NewProperty[T PropertyValueType](v T) PropertyValue
NewProperty creates a new PropertyValue.
func NewPropertyValue ¶
func NewPropertyValue(v interface{}) PropertyValue
NewPropertyValue turns a value into a property value, provided it is of a legal "JSON-like" kind.
func NewPropertyValueRepl ¶
func NewPropertyValueRepl(v interface{}, replk func(string) (PropertyKey, bool), replv func(interface{}) (PropertyValue, bool), ) PropertyValue
NewPropertyValueRepl turns a value into a property value, provided it is of a legal "JSON-like" kind. The replacement functions, replk and replv, may be supplied to transform keys and/or values as the mapping takes place.
func NewResourceReferenceProperty ¶
func NewResourceReferenceProperty(v ResourceReference) PropertyValue
func NewSecretProperty ¶
func NewSecretProperty(v *Secret) PropertyValue
func NewStringProperty ¶
func NewStringProperty(v string) PropertyValue
func ToResourcePropertyValue ¶ added in v3.111.0
func ToResourcePropertyValue(v property.Value) PropertyValue
Translate a Value into a PropertyValue.
This is a lossless transition, such that this will be true:
FromResourcePropertyValue(ToResourcePropertyValue(v)).Equals(v)
func (PropertyValue) ArchiveValue ¶
func (v PropertyValue) ArchiveValue() *archive.Archive
ArchiveValue fetches the underlying archive value (panicking if it isn't an archive).
func (PropertyValue) ArrayValue ¶
func (v PropertyValue) ArrayValue() []PropertyValue
ArrayValue fetches the underlying array value (panicking if it isn't a array).
func (PropertyValue) AssetValue ¶
func (v PropertyValue) AssetValue() *asset.Asset
AssetValue fetches the underlying asset value (panicking if it isn't an asset).
func (PropertyValue) BoolValue ¶
func (v PropertyValue) BoolValue() bool
BoolValue fetches the underlying bool value (panicking if it isn't a bool).
func (PropertyValue) ContainsSecrets ¶
func (v PropertyValue) ContainsSecrets() bool
ContainsSecrets returns true if the property value contains at least one secret (deeply).
func (PropertyValue) ContainsUnknowns ¶
func (v PropertyValue) ContainsUnknowns() bool
ContainsUnknowns returns true if the property value contains at least one unknown (deeply).
func (PropertyValue) DeepEquals ¶
func (v PropertyValue) DeepEquals(other PropertyValue) bool
DeepEquals returns true if this property map is deeply equal to the other property map; and false otherwise.
func (PropertyValue) DeepEqualsIncludeUnknowns ¶ added in v3.24.0
func (v PropertyValue) DeepEqualsIncludeUnknowns(other PropertyValue) bool
func (PropertyValue) Diff ¶
func (v PropertyValue) Diff(other PropertyValue, ignoreKeys ...IgnoreKeyFunc) *ValueDiff
Diff returns a diff by comparing a single property value to another; it returns nil if there are no diffs.
func (PropertyValue) DiffIncludeUnknowns ¶ added in v3.24.0
func (v PropertyValue) DiffIncludeUnknowns(other PropertyValue, ignoreKeys ...IgnoreKeyFunc) *ValueDiff
Diff returns a diff by comparing a single property value to another; it returns nil if there are no diffs.
func (PropertyValue) HasValue ¶
func (v PropertyValue) HasValue() bool
HasValue returns true if a value is semantically meaningful.
func (PropertyValue) Input ¶
func (v PropertyValue) Input() Computed
Input fetches the underlying computed value (panicking if it isn't a computed).
func (PropertyValue) IsArchive ¶
func (v PropertyValue) IsArchive() bool
IsArchive returns true if the underlying value is an object.
func (PropertyValue) IsArray ¶
func (v PropertyValue) IsArray() bool
IsArray returns true if the underlying value is an array.
func (PropertyValue) IsAsset ¶
func (v PropertyValue) IsAsset() bool
IsAsset returns true if the underlying value is an object.
func (PropertyValue) IsBool ¶
func (v PropertyValue) IsBool() bool
IsBool returns true if the underlying value is a bool.
func (PropertyValue) IsComputed ¶
func (v PropertyValue) IsComputed() bool
IsComputed returns true if the underlying value is a computed value.
func (PropertyValue) IsNull ¶
func (v PropertyValue) IsNull() bool
IsNull returns true if the underlying value is a null.
func (PropertyValue) IsNumber ¶
func (v PropertyValue) IsNumber() bool
IsNumber returns true if the underlying value is a number.
func (PropertyValue) IsObject ¶
func (v PropertyValue) IsObject() bool
IsObject returns true if the underlying value is an object.
func (PropertyValue) IsOutput ¶
func (v PropertyValue) IsOutput() bool
IsOutput returns true if the underlying value is an output value.
func (PropertyValue) IsResourceReference ¶
func (v PropertyValue) IsResourceReference() bool
IsResourceReference returns true if the underlying value is a resource reference value.
func (PropertyValue) IsSecret ¶
func (v PropertyValue) IsSecret() bool
IsSecret returns true if the underlying value is a secret value.
func (PropertyValue) IsString ¶
func (v PropertyValue) IsString() bool
IsString returns true if the underlying value is a string.
func (PropertyValue) MapRepl ¶
func (v PropertyValue) MapRepl(replk func(string) (string, bool), replv func(PropertyValue) (interface{}, bool), ) interface{}
MapRepl returns a mapper-compatible object map, suitable for deserialization into structures. A key and/or value replace function, replk/replv, may be passed that will replace elements using custom logic if appropriate.
func (PropertyValue) Mappable ¶
func (v PropertyValue) Mappable() interface{}
Mappable returns a mapper-compatible value, suitable for deserialization into structures.
func (PropertyValue) NumberValue ¶
func (v PropertyValue) NumberValue() float64
NumberValue fetches the underlying number value (panicking if it isn't a number).
func (PropertyValue) ObjectValue ¶
func (v PropertyValue) ObjectValue() PropertyMap
ObjectValue fetches the underlying object value (panicking if it isn't a object).
func (PropertyValue) OutputValue ¶
func (v PropertyValue) OutputValue() Output
OutputValue fetches the underlying output value (panicking if it isn't a output).
func (PropertyValue) ResourceReferenceValue ¶
func (v PropertyValue) ResourceReferenceValue() ResourceReference
ResourceReferenceValue fetches the underlying resource reference value (panicking if it isn't a resource reference).
func (PropertyValue) SecretValue ¶
func (v PropertyValue) SecretValue() *Secret
SecretValue fetches the underlying secret value (panicking if it isn't a secret).
func (PropertyValue) String ¶
func (v PropertyValue) String() string
String implements the fmt.Stringer interface to add slightly more information to the output.
func (PropertyValue) StringValue ¶
func (v PropertyValue) StringValue() string
StringValue fetches the underlying string value (panicking if it isn't a string).
func (PropertyValue) TypeString ¶
func (v PropertyValue) TypeString() string
TypeString returns a type representation of the property value's holder type.
type PropertyValueType ¶ added in v3.94.0
type PropertyValueType interface { bool | float64 | string | *asset.Asset | *archive.Archive | Computed | Output | *Secret | ResourceReference | []PropertyValue | PropertyMap }
PropertyValueType enumerates the actual types that may be stored in a PropertyValue.
type ReqError ¶
type ReqError struct {
K PropertyKey
}
type ResourceReference ¶
type ResourceReference struct { URN URN ID PropertyValue PackageVersion string }
ResourceReference is a property value that represents a reference to a Resource. The reference captures the resource's URN, ID, and the version of its containing package. Note that there are several cases to consider with respect to the ID:
- The reference may not contain an ID if the referenced resource is a component resource. In this case, the ID will be null.
- The ID may be unknown (in which case it will be the unknown property value)
- Otherwise, the ID must be a string.
func (ResourceReference) Equal ¶ added in v3.111.0
func (ref ResourceReference) Equal(other ResourceReference) bool
func (ResourceReference) IDString ¶
func (ref ResourceReference) IDString() (value string, hasID bool)
type Secret ¶
type Secret struct {
Element PropertyValue
}
Secret indicates that the underlying value should be persisted securely.
In order to facilitate the ability to distinguish secrets with identical plaintext in downstream code that may want to cache a secret's ciphertext, secret PropertyValues hold the address of the Secret. If a secret must be copied, its value--not its address--should be copied.
type State ¶
type State struct { // Currently the engine implements RegisterResourceOutputs by directly mutating the state to change the `Outputs`. This // triggers a race between the snapshot serialization code and the engine. Ideally we'd do a more principled fix, but // just locking in these two places is sufficient to stop the race detector from firing on integration tests. Lock sync.Mutex Type tokens.Type // the resource's type. URN URN // the resource's object urn, a human-friendly, unique name for the resource. Custom bool // true if the resource is custom, managed by a plugin. Delete bool // true if this resource is pending deletion due to a replacement. ID ID // the resource's unique ID, assigned by the resource provider (or blank if none/uncreated). Inputs PropertyMap // the resource's input properties (as specified by the program). Outputs PropertyMap // the resource's complete output state (as returned by the resource provider). Parent URN // an optional parent URN that this resource belongs to. Protect bool // true to "protect" this resource (protected resources cannot be deleted). External bool // true if this resource is "external" to Pulumi and we don't control the lifecycle. Dependencies []URN // the resource's dependencies. InitErrors []string // the set of errors encountered in the process of initializing resource. Provider string // the provider to use for this resource. PropertyDependencies map[PropertyKey][]URN // the set of dependencies that affect each property. PendingReplacement bool // true if this resource was deleted and is awaiting replacement. AdditionalSecretOutputs []PropertyKey // an additional set of outputs that should be treated as secrets. Aliases []URN // an optional set of URNs for which this resource is an alias. CustomTimeouts CustomTimeouts // A config block that will be used to configure timeouts for CRUD operations. ImportID ID // the resource's import id, if this was an imported resource. RetainOnDelete bool // if set to True, the providers Delete method will not be called for this resource. DeletedWith URN // If set, the providers Delete method will not be called for this resource if specified resource is being deleted as well. Created *time.Time // If set, the time when the state was initially added to the state file. (i.e. Create, Import) Modified *time.Time // If set, the time when the state was last modified in the state file. SourcePosition string // If set, the source location of the resource registration IgnoreChanges []string // If set, the list of properties to ignore changes for. }
State is a structure containing state associated with a resource. This resource may have been serialized and deserialized, or snapshotted from a live graph of resource objects. The value's state is not, however, associated with any runtime objects in memory that may be actively involved in ongoing computations.
func NewState ¶
func NewState(t tokens.Type, urn URN, custom bool, del bool, id ID, inputs PropertyMap, outputs PropertyMap, parent URN, protect bool, external bool, dependencies []URN, initErrors []string, provider string, propertyDependencies map[PropertyKey][]URN, pendingReplacement bool, additionalSecretOutputs []PropertyKey, aliases []URN, timeouts *CustomTimeouts, importID ID, retainOnDelete bool, deletedWith URN, created *time.Time, modified *time.Time, sourcePosition string, ignoreChanges []string, ) *State
NewState creates a new resource value from existing resource state information.
func (*State) Copy ¶ added in v3.113.0
Copy creates a deep copy of the resource state, except without copying the lock.
func (*State) GetAliasURNs ¶ added in v3.43.0
func (*State) GetAliases ¶ added in v3.43.0
func (*State) GetAllDependencies ¶ added in v3.134.0
func (s *State) GetAllDependencies() (string, []StateDependency)
GetAllDependencies returns a resource's provider and all of its dependencies. For use cases that rely on processing all possible links between sets of resources, this method (coupled with e.g. an exhaustive switch over the types of dependencies returned) should be preferred over direct access to e.g. Dependencies, PropertyDependencies, and so on.
type StateDependency ¶ added in v3.134.0
type StateDependency struct { // The type of dependency. Type StateDependencyType // If the dependency is a property dependency, the property key that owns the // dependency. Key PropertyKey // The URN of the resource that is being depended on. URN URN }
StateDependency objects are used when enumerating all the dependencies of a resource. They encapsulate the various types of dependency relationships that Pulumi resources may have with one another.
type StateDependencyType ¶ added in v3.134.0
type StateDependencyType string
The type of dependencies that a resource may have.
const ( // ResourceParent is the type of parent-child dependency relationships. The // resource being depended on is the parent of the dependent resource. ResourceParent StateDependencyType = "parent" // ResourceDependency is the type of dependency relationships where there is // no specific property owning the dependency. ResourceDependency StateDependencyType = "dependency" // ResourcePropertyDependency is the type of dependency relationships where a // specific property makes reference to another resource. ResourcePropertyDependency StateDependencyType = "property-dependency" // ResourceDeletedWith is the type of dependency relationships where a // resource will be "deleted with" another. The resource being depended on is // one whose deletion subsumes the deletion of the dependent resource. ResourceDeletedWith StateDependencyType = "deleted-with" )
type Status ¶
type Status int
Status is returned when an error has occurred during a resource provider operation. It indicates whether the operation could be rolled back cleanly (OK). If not, it means the resource was left in an indeterminate state.
type URN ¶
URN is a friendly, but unique, URN for a resource, most often auto-assigned by Pulumi. These are used as unique IDs for objects, and help us to perform graph diffing and resolution of resource objects.
In theory, we could support manually assigned URIs in the future. For the time being, however, we have opted to simplify developers' lives by mostly automating the generation of them algorithmically. The one caveat where it isn't truly automatic is that a developer -- or resource provider -- must provide a semi-unique name part.
Each resource URN is of the form:
urn:pulumi:<Stack>::<Project>::<Qualified$Type$Name>::<Name>
wherein each element is the following:
<Stack> The stack being deployed into <Project> The project being evaluated <Qualified$Type$Name> The object type's qualified type token (including the parent type) <Name> The human-friendly name identifier assigned by the developer or provider
In the future, we may add elements to the URN; it is more important that it is unique than it is human-typable.
func CreateURN ¶ added in v3.43.0
CreateURN computes a URN from the combination of a resource name, resource type, and optional parent,
func DefaultRootStackURN ¶
func DefaultRootStackURN(stack tokens.QName, proj tokens.PackageName) URN
DefaultRootStackURN constructs a default root stack URN for the given stack and project.
func NewURN ¶
func NewURN(stack tokens.QName, proj tokens.PackageName, parentType, baseType tokens.Type, name string) URN
NewURN creates a unique resource URN for the given resource object.
func ParseOptionalURN ¶ added in v3.76.0
ParseOptionalURN is the same as ParseURN except it will allow the empty string.
type ValueDiff ¶
type ValueDiff struct { Old PropertyValue // the old value. New PropertyValue // the new value. Array *ArrayDiff // the array's detailed diffs (only for arrays). Object *ObjectDiff // the object's detailed diffs (only for objects). }
ValueDiff holds the results of diffing two property values.