pulumi

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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

func RunErr(body RunFunc) error

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.

Types

type ArchiveOutput

type ArchiveOutput Output

ArchiveOutput is an Output that is typed to return archive values.

func (*ArchiveOutput) Apply

func (out *ArchiveOutput) Apply(applier func(asset.Archive) (interface{}, error)) *Output

Apply applies a transformation to the archive value when it is available.

func (*ArchiveOutput) Value

func (out *ArchiveOutput) Value() (asset.Archive, bool, error)

Value returns the underlying archive value.

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.

func (*AssetOutput) Apply

func (out *AssetOutput) Apply(applier func(asset.Asset) (interface{}, error)) *Output

Apply applies a transformation to the asset value when it is available.

func (*AssetOutput) Value

func (out *AssetOutput) Value() (asset.Asset, bool, error)

Value returns the underlying asset value.

type BoolOutput

type BoolOutput Output

BoolOutput is an Output that is typed to return bool values.

func (*BoolOutput) Apply

func (out *BoolOutput) Apply(applier func(bool) (interface{}, error)) *Output

Apply applies a transformation to the bool value when it is available.

func (*BoolOutput) Value

func (out *BoolOutput) Value() (bool, bool, error)

Value returns the underlying bool value.

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

func NewContext(ctx context.Context, info RunInfo) (*Context, error)

NewContext creates a fresh run context out of the given metadata.

func (*Context) Close

func (ctx *Context) Close() error

Close implements io.Closer and relinquishes any outstanding resources held by the context.

func (*Context) DryRun

func (ctx *Context) DryRun() bool

DryRun is true when evaluating a program for purposes of planning, instead of performing a true deployment.

func (*Context) Export

func (ctx *Context) Export(name string, value interface{})

Export registers a key and value pair with the current context's stack.

func (*Context) GetConfig

func (ctx *Context) GetConfig(key string) (string, bool)

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{}) (map[string]interface{}, error)

Invoke will invoke a provider's function, identified by its token tok. This function call is synchronous.

func (*Context) Parallel

func (ctx *Context) Parallel() int

Parallel returns the degree of parallelism currently being used by the engine (1 being entirely serial).

func (*Context) Project

func (ctx *Context) Project() string

Project returns the current project name.

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

func (ctx *Context) RegisterResourceOutputs(urn URN, outs map[string]interface{}) error

RegisterResourceOutputs completes the resource registration, attaching an optional set of computed outputs.

func (*Context) Stack

func (ctx *Context) Stack() string

Stack returns the current stack name being deployed into.

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() ID
}

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.

func (*Float32Output) Apply

func (out *Float32Output) Apply(applier func(float32) (interface{}, error)) *Output

Apply applies a transformation to the float32 value when it is available.

func (*Float32Output) Value

func (out *Float32Output) Value() (float32, bool, error)

Value returns the underlying number value.

type Float64Output

type Float64Output Output

Float64Output is an Output that is typed to return float64 values.

func (*Float64Output) Apply

func (out *Float64Output) Apply(applier func(float64) (interface{}, error)) *Output

Apply applies a transformation to the float64 value when it is available.

func (*Float64Output) Value

func (out *Float64Output) Value() (float64, bool, error)

Value returns the underlying number value.

type ID

type ID string

ID is a unique identifier assigned by a resource provider to a resource.

type IDOutput

type IDOutput Output

IDOutput is an Output that is typed to return ID values.

func (*IDOutput) Apply

func (out *IDOutput) Apply(applier func(ID) (interface{}, error)) *Output

Apply applies a transformation to the ID value when it is available.

func (*IDOutput) Value

func (out *IDOutput) Value() (ID, bool, error)

Value returns the underlying number value.

type Int16Output

type Int16Output Output

Int16Output is an Output that is typed to return int16 values.

func (*Int16Output) Apply

func (out *Int16Output) Apply(applier func(int16) (interface{}, error)) *Output

Apply applies a transformation to the int16 value when it is available.

func (*Int16Output) Value

func (out *Int16Output) Value() (int16, bool, error)

Value returns the underlying number value.

type Int32Output

type Int32Output Output

Int32Output is an Output that is typed to return int32 values.

func (*Int32Output) Apply

func (out *Int32Output) Apply(applier func(int32) (interface{}, error)) *Output

Apply applies a transformation to the int32 value when it is available.

func (*Int32Output) Value

func (out *Int32Output) Value() (int32, bool, error)

Value returns the underlying number value.

type Int64Output

type Int64Output Output

Int64Output is an Output that is typed to return int64 values.

func (*Int64Output) Apply

func (out *Int64Output) Apply(applier func(int64) (interface{}, error)) *Output

Apply applies a transformation to the int64 value when it is available.

func (*Int64Output) Value

func (out *Int64Output) Value() (int64, bool, error)

Value returns the underlying number value.

type Int8Output

type Int8Output Output

Int8Output is an Output that is typed to return int8 values.

func (*Int8Output) Apply

func (out *Int8Output) Apply(applier func(int8) (interface{}, error)) *Output

Apply applies a transformation to the int8 value when it is available.

func (*Int8Output) Value

func (out *Int8Output) Value() (int8, bool, error)

Value returns the underlying number value.

type IntOutput

type IntOutput Output

IntOutput is an Output that is typed to return int values.

func (*IntOutput) Apply

func (out *IntOutput) Apply(applier func(int) (interface{}, error)) *Output

Apply applies a transformation to the int value when it is available.

func (*IntOutput) Value

func (out *IntOutput) Value() (int, bool, error)

Value returns the underlying number value.

type MapOutput

type MapOutput Output

MapOutput is an Output that is typed to return map values.

func (*MapOutput) Apply

func (out *MapOutput) Apply(applier func(map[string]interface{}) (interface{}, error)) *Output

Apply applies a transformation to the number value when it is available.

func (*MapOutput) Value

func (out *MapOutput) Value() (map[string]interface{}, bool, error)

Value returns the underlying number value.

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

func NewOutput(deps []Resource) (*Output, func(interface{}, bool), func(error))

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

func (out *Output) Apply(applier func(v interface{}) (interface{}, error)) *Output

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

func (out *Output) Archive() (asset.Archive, bool, error)

Archive retrives the underlying value for this output property as an archive.

func (*Output) Array

func (out *Output) Array() ([]interface{}, bool, error)

Array retrives the underlying value for this output property as an array.

func (*Output) Asset

func (out *Output) Asset() (asset.Asset, bool, error)

Asset retrives the underlying value for this output property as an asset.

func (*Output) Bool

func (out *Output) Bool() (bool, bool, error)

Bool retrives the underlying value for this output property as a bool.

func (*Output) Deps

func (out *Output) Deps() []Resource

Deps returns the dependencies for this output property.

func (*Output) Float32

func (out *Output) Float32() (float32, bool, error)

Float32 retrives the underlying value for this output property as a float32.

func (*Output) Float64

func (out *Output) Float64() (float64, bool, error)

Float64 retrives the underlying value for this output property as a float64.

func (*Output) ID

func (out *Output) ID() (ID, bool, error)

ID retrives the underlying value for this output property as an ID.

func (*Output) Int

func (out *Output) Int() (int, bool, error)

Int retrives the underlying value for this output property as a int.

func (*Output) Int16

func (out *Output) Int16() (int16, bool, error)

Int16 retrives the underlying value for this output property as a int16.

func (*Output) Int32

func (out *Output) Int32() (int32, bool, error)

Int32 retrives the underlying value for this output property as a int32.

func (*Output) Int64

func (out *Output) Int64() (int64, bool, error)

Int64 retrives the underlying value for this output property as a int64.

func (*Output) Int8

func (out *Output) Int8() (int8, bool, error)

Int8 retrives the underlying value for this output property as a int8.

func (*Output) Map

func (out *Output) Map() (map[string]interface{}, bool, error)

Map retrives the underlying value for this output property as a map.

func (*Output) String

func (out *Output) String() (string, bool, error)

String retrives the underlying value for this output property as a string.

func (*Output) URN

func (out *Output) URN() (URN, error)

URN retrives the underlying value for this output property as a URN.

func (*Output) Uint

func (out *Output) Uint() (uint, bool, error)

Uint retrives the underlying value for this output property as a uint.

func (*Output) Uint16

func (out *Output) Uint16() (uint16, bool, error)

Uint16 retrives the underlying value for this output property as a uint16.

func (*Output) Uint32

func (out *Output) Uint32() (uint32, bool, error)

Uint32 retrives the underlying value for this output property as a uint32.

func (*Output) Uint64

func (out *Output) Uint64() (uint64, bool, error)

Uint64 retrives the underlying value for this output property as a uint64.

func (*Output) Uint8

func (out *Output) Uint8() (uint8, bool, error)

Uint8 retrives the underlying value for this output property as a uint8.

func (*Output) Value

func (out *Output) Value() (interface{}, bool, error)

Value retrieves the underlying value for this output property.

type Outputs

type Outputs map[string]*Output

Outputs is a map of property name to value, one for each resource output property.

type Resource

type Resource interface {
	// URN is this resource's stable logical URN used to distinctly address it before, during, and after deployments.
	URN() URN
}

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
}

ResourceOpt contains optional settings that control a resource's behavior.

type ResourceState

type ResourceState struct {
	// URN will resolve to the resource's URN after registration has completed.
	URN *URNOutput
	// ID will resolve to the resource's ID after registration, provided this is for a custom resource.
	ID *IDOutput
	// State contains the full set of expected output properties and will resolve after completion.
	State Outputs
}

ResourceState contains the results of a resource registration operation.

type RunFunc

type RunFunc func(ctx *Context) error

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.

func (*StringOutput) Apply

func (out *StringOutput) Apply(applier func(string) (interface{}, error)) *Output

Apply applies a transformation to the number value when it is available.

func (*StringOutput) Value

func (out *StringOutput) Value() (string, bool, error)

Value returns the underlying number value.

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.

func (*URNOutput) Apply

func (out *URNOutput) Apply(applier func(URN) (interface{}, error)) *Output

Apply applies a transformation to the URN value when it is available.

func (*URNOutput) Value

func (out *URNOutput) Value() (URN, error)

Value returns the underlying number value.

type Uint16Output

type Uint16Output Output

Uint16Output is an Output that is typed to return uint16 values.

func (*Uint16Output) Apply

func (out *Uint16Output) Apply(applier func(uint16) (interface{}, error)) *Output

Apply applies a transformation to the uint16 value when it is available.

func (*Uint16Output) Value

func (out *Uint16Output) Value() (uint16, bool, error)

Value returns the underlying number value.

type Uint32Output

type Uint32Output Output

Uint32Output is an Output that is typed to return uint32 values.

func (*Uint32Output) Apply

func (out *Uint32Output) Apply(applier func(uint32) (interface{}, error)) *Output

Apply applies a transformation to the uint32 value when it is available.

func (*Uint32Output) Value

func (out *Uint32Output) Value() (uint32, bool, error)

Value returns the underlying number value.

type Uint64Output

type Uint64Output Output

Uint64Output is an Output that is typed to return uint64 values.

func (*Uint64Output) Apply

func (out *Uint64Output) Apply(applier func(uint64) (interface{}, error)) *Output

Apply applies a transformation to the uint64 value when it is available.

func (*Uint64Output) Value

func (out *Uint64Output) Value() (uint64, bool, error)

Value returns the underlying number value.

type Uint8Output

type Uint8Output Output

Uint8Output is an Output that is typed to return uint8 values.

func (*Uint8Output) Apply

func (out *Uint8Output) Apply(applier func(uint8) (interface{}, error)) *Output

Apply applies a transformation to the uint8 value when it is available.

func (*Uint8Output) Value

func (out *Uint8Output) Value() (uint8, bool, error)

Value returns the underlying number value.

type UintOutput

type UintOutput Output

UintOutput is an Output that is typed to return uint values.

func (*UintOutput) Apply

func (out *UintOutput) Apply(applier func(uint) (interface{}, error)) *Output

Apply applies a transformation to the uint value when it is available.

func (*UintOutput) Value

func (out *UintOutput) Value() (uint, bool, error)

Value returns the underlying number value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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