Documentation ¶
Index ¶
- Constants
- func Run(body RunFunc)
- func RunErr(body RunFunc) error
- func RunWithContext(ctx *Context, body RunFunc) error
- type ArchiveOutput
- type ArrayOutput
- type AssetOutput
- type BoolOutput
- type ComponentResource
- type Context
- func (ctx *Context) Close() error
- func (ctx *Context) DryRun() bool
- func (ctx *Context) Export(name string, value interface{})
- func (ctx *Context) GetConfig(key string) (string, bool)
- func (ctx *Context) Invoke(tok string, args map[string]interface{}, opts ...InvokeOpt) (map[string]interface{}, error)
- func (ctx *Context) Parallel() int
- func (ctx *Context) Project() string
- func (ctx *Context) ReadResource(t, name string, id ID, props map[string]interface{}, opts ...ResourceOpt) (*ResourceState, error)
- func (ctx *Context) RegisterResource(t, name string, custom bool, props map[string]interface{}, opts ...ResourceOpt) (*ResourceState, error)
- func (ctx *Context) RegisterResourceOutputs(urn URN, outs map[string]interface{}) error
- func (ctx *Context) Stack() string
- type CustomResource
- type Float32Output
- type Float64Output
- type ID
- type IDOutput
- type Int16Output
- type Int32Output
- type Int64Output
- type Int8Output
- type IntOutput
- type InvokeOpt
- type MapOutput
- type Output
- func (out *Output) Apply(applier func(v interface{}) (interface{}, error)) *Output
- func (out *Output) Archive() (asset.Archive, bool, error)
- func (out *Output) Array() ([]interface{}, bool, error)
- func (out *Output) Asset() (asset.Asset, bool, error)
- func (out *Output) Bool() (bool, bool, error)
- func (out *Output) Deps() []Resource
- func (out *Output) Float32() (float32, bool, error)
- func (out *Output) Float64() (float64, bool, error)
- func (out *Output) ID() (ID, bool, error)
- func (out *Output) Int() (int, bool, error)
- func (out *Output) Int16() (int16, bool, error)
- func (out *Output) Int32() (int32, bool, error)
- func (out *Output) Int64() (int64, bool, error)
- func (out *Output) Int8() (int8, bool, error)
- func (out *Output) Map() (map[string]interface{}, bool, error)
- func (out *Output) String() (string, bool, error)
- func (out *Output) URN() (URN, error)
- func (out *Output) Uint() (uint, bool, error)
- func (out *Output) Uint16() (uint16, bool, error)
- func (out *Output) Uint32() (uint32, bool, error)
- func (out *Output) Uint64() (uint64, bool, error)
- func (out *Output) Uint8() (uint8, bool, error)
- func (out *Output) Value() (interface{}, bool, error)
- type Outputs
- type ProviderResource
- type Resource
- type ResourceOpt
- type ResourceState
- type RunFunc
- type RunInfo
- type StringOutput
- type URN
- type URNOutput
- type Uint16Output
- type Uint32Output
- type Uint64Output
- type Uint8Output
- type UintOutput
Constants ¶
const ( // EnvProject is the envvar used to read the current Pulumi project name. EnvProject = "PULUMI_PROJECT" // EnvStack is the envvar used to read the current Pulumi stack name. EnvStack = "PULUMI_STACK" // EnvConfig is the envvar used to read the current Pulumi configuration variables. EnvConfig = "PULUMI_CONFIG" // EnvParallel is the envvar used to read the current Pulumi degree of parallelism. EnvParallel = "PULUMI_PARALLEL" // EnvDryRun is the envvar used to read the current Pulumi dry-run setting. EnvDryRun = "PULUMI_DRY_RUN" // EnvMonitor is the envvar used to read the current Pulumi monitor RPC address. EnvMonitor = "PULUMI_MONITOR" // EnvEngine is the envvar used to read the current Pulumi engine RPC address. EnvEngine = "PULUMI_ENGINE" )
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(body RunFunc)
Run executes the body of a Pulumi program, granting it access to a deployment context that it may use to register resources and orchestrate deployment activities. This connects back to the Pulumi engine using gRPC. If the program fails, the process will be terminated and the function will not return.
func RunErr ¶
RunErr executes the body of a Pulumi program, granting it access to a deployment context that it may use to register resources and orchestrate deployment activities. This connects back to the Pulumi engine using gRPC.
func RunWithContext ¶ added in v0.16.4
RunWithContext runs the body of a Pulumi program using the given Context for information about the target stack, configuration, and engine connection.
Types ¶
type ArchiveOutput ¶
type ArchiveOutput Output
ArchiveOutput is an Output that is typed to return archive values.
type ArrayOutput ¶
type ArrayOutput Output
ArrayOutput is an Output that is typed to return arrays of values.
func (*ArrayOutput) Apply ¶
func (out *ArrayOutput) Apply(applier func([]interface{}) (interface{}, error)) *Output
Apply applies a transformation to the array value when it is available.
func (*ArrayOutput) Value ¶
func (out *ArrayOutput) Value() ([]interface{}, bool, error)
Value returns the underlying array value.
type AssetOutput ¶
type AssetOutput Output
AssetOutput is an Output that is typed to return asset values.
type BoolOutput ¶
type BoolOutput Output
BoolOutput is an Output that is typed to return bool values.
type ComponentResource ¶
type ComponentResource interface { Resource }
ComponentResource is a resource that aggregates one or more other child resources into a higher level abstraction. The component resource itself is a resource, but does not require custom CRUD operations for provisioning.
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context handles registration of resources and exposes metadata about the current deployment context.
func NewContext ¶
NewContext creates a fresh run context out of the given metadata.
func (*Context) Close ¶
Close implements io.Closer and relinquishes any outstanding resources held by the context.
func (*Context) DryRun ¶
DryRun is true when evaluating a program for purposes of planning, instead of performing a true deployment.
func (*Context) GetConfig ¶
GetConfig returns the config value, as a string, and a bool indicating whether it exists or not.
func (*Context) Invoke ¶
func (ctx *Context) Invoke(tok string, args map[string]interface{}, opts ...InvokeOpt) (map[string]interface{}, error)
Invoke will invoke a provider's function, identified by its token tok. This function call is synchronous.
func (*Context) Parallel ¶
Parallel returns the degree of parallelism currently being used by the engine (1 being entirely serial).
func (*Context) ReadResource ¶
func (ctx *Context) ReadResource( t, name string, id ID, props map[string]interface{}, opts ...ResourceOpt) (*ResourceState, error)
ReadResource reads an existing custom resource's state from the resource monitor. Note that resources read in this way will not be part of the resulting stack's state, as they are presumed to belong to another.
func (*Context) RegisterResource ¶
func (ctx *Context) RegisterResource( t, name string, custom bool, props map[string]interface{}, opts ...ResourceOpt) (*ResourceState, error)
RegisterResource creates and registers a new resource object. t is the fully qualified type token and name is the "name" part to use in creating a stable and globally unique URN for the object. state contains the goal state for the resource object and opts contains optional settings that govern the way the resource is created.
func (*Context) RegisterResourceOutputs ¶
RegisterResourceOutputs completes the resource registration, attaching an optional set of computed outputs.
type CustomResource ¶
type CustomResource interface { Resource // ID is the provider-assigned unique identifier for this managed resource. It is set during deployments, // but might be missing ("") during planning phases. ID() *IDOutput }
CustomResource is a cloud resource whose create, read, update, and delete (CRUD) operations are managed by performing external operations on some physical entity. The engine understands how to diff and perform partial updates of them, and these CRUD operations are implemented in a dynamically loaded plugin for the defining package.
type Float32Output ¶
type Float32Output Output
Float32Output is an Output that is typed to return float32 values.
type Float64Output ¶
type Float64Output Output
Float64Output is an Output that is typed to return float64 values.
type IDOutput ¶
type IDOutput Output
IDOutput is an Output that is typed to return ID values.
type Int16Output ¶
type Int16Output Output
Int16Output is an Output that is typed to return int16 values.
type Int32Output ¶
type Int32Output Output
Int32Output is an Output that is typed to return int32 values.
type Int64Output ¶
type Int64Output Output
Int64Output is an Output that is typed to return int64 values.
type Int8Output ¶
type Int8Output Output
Int8Output is an Output that is typed to return int8 values.
type IntOutput ¶
type IntOutput Output
IntOutput is an Output that is typed to return int values.
type InvokeOpt ¶ added in v0.16.4
type InvokeOpt struct { // Provider is an optional provider resource to use for this invoke. Provider ProviderResource }
InvokeOpt contains optional settings that control an invoke's behavior.
type MapOutput ¶
type MapOutput Output
MapOutput is an Output that is typed to return map values.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output helps encode the relationship between resources in a Pulumi application. Specifically an output property holds onto a value and the resource it came from. An output value can then be provided when constructing new resources, allowing that new resource to know both the value as well as the resource the value came from. This allows for a precise "dependency graph" to be created, which properly tracks the relationship between resources.
func NewOutput ¶
NewOutput returns an output value that can be used to rendezvous with the production of a value or error. The function returns the output itself, plus two functions: one for resolving a value, and another for rejecting with an error; exactly one function must be called. This acts like a promise.
func (*Output) Apply ¶
Apply transforms the data of the output property using the applier func. The result remains an output property, and accumulates all implicated dependencies, so that resources can be properly tracked using a DAG. This function does not block awaiting the value; instead, it spawns a Goroutine that will await its availability.
func (*Output) Archive ¶
Archive retrives the underlying value for this output property as an archive.
func (*Output) Float32 ¶
Float32 retrives the underlying value for this output property as a float32.
func (*Output) Float64 ¶
Float64 retrives the underlying value for this output property as a float64.
type ProviderResource ¶ added in v0.16.4
type ProviderResource interface { CustomResource }
ProviderResource is a resource that represents a configured instance of a particular package's provider plugin. These resources are supply the implementations of their package's CRUD operations. A specific provider instance can be used for a given resource by passing it in ResourceOpt.Provider.
type Resource ¶
type Resource interface { // URN is this resource's stable logical URN used to distinctly address it before, during, and after deployments. URN() *URNOutput }
Resource represents a cloud resource managed by Pulumi.
type ResourceOpt ¶
type ResourceOpt struct { // Parent is an optional parent resource to which this resource belongs. Parent Resource // DependsOn is an optional array of explicit dependencies on other resources. DependsOn []Resource // Protect, when set to true, ensures that this resource cannot be deleted (without first setting it to false). Protect bool // Provider is an optional provider resource to use for this resource's CRUD operations. Provider ProviderResource // DeleteBeforeReplace, when set to true, ensures that this resource is deleted prior to replacement. DeleteBeforeReplace bool }
ResourceOpt contains optional settings that control a resource's behavior.
type ResourceState ¶
type ResourceState struct { // State contains the full set of expected output properties and will resolve after completion. State Outputs // contains filtered or unexported fields }
ResourceState contains the results of a resource registration operation.
func (*ResourceState) ID ¶
func (s *ResourceState) ID() *IDOutput
ID will resolve to the resource's ID after registration, provided this is for a custom resource.
func (*ResourceState) URN ¶
func (s *ResourceState) URN() *URNOutput
URN will resolve to the resource's URN after registration has completed.
type RunFunc ¶
RunFunc executes the body of a Pulumi program. It may register resources using the deployment context supplied as an arguent and any non-nil return value is interpreted as a program error by the Pulumi runtime.
type RunInfo ¶
type RunInfo struct { Project string Stack string Config map[string]string Parallel int DryRun bool MonitorAddr string EngineAddr string }
RunInfo contains all the metadata about a run request.
type StringOutput ¶
type StringOutput Output
StringOutput is an Output that is typed to return number values.
type URN ¶
type URN string
URN is an automatically generated logical URN, used to stably identify resources.
type URNOutput ¶
type URNOutput Output
URNOutput is an Output that is typed to return URN values.
type Uint16Output ¶
type Uint16Output Output
Uint16Output is an Output that is typed to return uint16 values.
type Uint32Output ¶
type Uint32Output Output
Uint32Output is an Output that is typed to return uint32 values.
type Uint64Output ¶
type Uint64Output Output
Uint64Output is an Output that is typed to return uint64 values.
type Uint8Output ¶
type Uint8Output Output
Uint8Output is an Output that is typed to return uint8 values.
type UintOutput ¶
type UintOutput Output
UintOutput is an Output that is typed to return uint values.