Package @pulumi/pulumi

var pulumi = require("@pulumi/pulumi");
import * as pulumi from "@pulumi/pulumi";

class ComponentResource

extends 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.

constructor

new ComponentResource(type: string, name: string, unused?: Inputs, opts: ComponentResourceOptions)

Creates and registers a new component resource. [type] 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. [opts.parent] is the optional parent for this component, and [opts.dependsOn] is an optional list of other resources that this resource depends on, controlling the order in which we perform resource operations.

  • name The unique name of the resource.
  • unused . Component resources do not communicate or store their properties with the Pulumi engine.
  • opts A bag of options that control this resource's behavior.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

method registerOutputs

protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): void

property __childResources

public __childResources: Set<Resource> | undefined;

The child resources of this resource. We use these (only from a ComponentResource) to allow code to dependOn a ComponentResource and have that effectively mean that it is depending on all the CustomResource children of that component.

Important! We only walk through ComponentResources. They’re the only resources that serve as an aggregation of other primitive (i.e. custom) resources. While a custom resource can be a parent of other resources, we don’t want to ever depend on those child resource. If we do, it’s simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it.

An example of how this would be bad is:

    var c1 = new CustomResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.id }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.id }, { parent: c1 });

The problem here is that ‘c2’ has a data dependency on ‘c1’. If it tries to wait on ‘c1’ it will walk to the children and wait on them. This will mean it will wait on ‘c3’. But ‘c3’ will be waiting in the same manner on ‘c2’, and a cycle forms.

This normally does not happen with ComponentResources as they do not have any data flowing into them. The only way you would be able to have a problem is if you had this sort of coding pattern:

    var c1 = new ComponentResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.urn }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.urn }, { parent: c1 });

However, this would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it’s acceptable if that sort of pattern failed in practice.

property __parentResource

public __parentResource: Resource | undefined;

The optional parent of this resource.

property __pulumiComponentResource

public __pulumiComponentResource: boolean;

A private field to help with RTTI that works in SxS scenarios.

property __pulumiResource

public __pulumiResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property urn

public urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Config

Config is a bag of related configuration state. Each bag contains any number of configuration variables, indexed by simple keys, and each has a name that uniquely identifies it; two bags with different names do not share values for variables that otherwise share the same key. For example, a bag whose name is pulumi:foo, with keys a, b, and c, is entirely separate from a bag whose name is pulumi:bar with the same simple key names. Each key has a fully qualified names, such as pulumi:foo:a, …, and pulumi:bar:a, respectively.

constructor

new Config(name?: undefined | string)

method get

public get(key: string, opts?: StringConfigOptions): string | undefined

get loads an optional configuration value by its key, or undefined if it doesn’t exist.

method getBoolean

public getBoolean(key: string): boolean | undefined

getBoolean loads an optional configuration value, as a boolean, by its key, or undefined if it doesn’t exist. If the configuration value isn’t a legal boolean, this function will throw an error.

method getNumber

public getNumber(key: string, opts?: NumberConfigOptions): number | undefined

getNumber loads an optional configuration value, as a number, by its key, or undefined if it doesn’t exist. If the configuration value isn’t a legal number, this function will throw an error.

method getObject

public getObject<T>(key: string): T | undefined

getObject loads an optional configuration value, as an object, by its key, or undefined if it doesn’t exist. This routine simply JSON parses and doesn’t validate the shape of the contents.

method require

public require(key: string, opts?: StringConfigOptions): string

require loads a configuration value by its given key. If it doesn’t exist, an error is thrown.

method requireBoolean

public requireBoolean(key: string): boolean

requireBoolean loads a configuration value, as a boolean, by its given key. If it doesn’t exist, or the configuration value is not a legal boolean, an error is thrown.

method requireNumber

public requireNumber(key: string, opts?: NumberConfigOptions): number

requireNumber loads a configuration value, as a number, by its given key. If it doesn’t exist, or the configuration value is not a legal number, an error is thrown.

method requireObject

public requireObject<T>(key: string): T

requireObject loads a configuration value as a JSON string and deserializes the JSON into a JavaScript object. If it doesn’t exist, or the configuration value is not a legal JSON string, an error is thrown.

property name

public name: string;

name is the configuration bag’s logical name and uniquely identifies it. The default is the name of the current project.

class CustomResource

extends Resource

CustomResource is a 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.

constructor

new CustomResource(t: string, name: string, props?: Inputs, opts?: CustomResourceOptions)

Creates and registers a new managed resource. 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. dependsOn is an optional list of other resources that this resource depends on, controlling the order in which we perform resource operations. Creating an instance does not necessarily perform a create on the physical entity which it represents, and instead, this is dependent upon the diffing of the new goal state compared to the current known resource state.

  • t The type of the resource.
  • name The unique name of the resource.
  • props The arguments to use to populate the new resource.
  • opts A bag of options that control this resource's behavior.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property __childResources

public __childResources: Set<Resource> | undefined;

The child resources of this resource. We use these (only from a ComponentResource) to allow code to dependOn a ComponentResource and have that effectively mean that it is depending on all the CustomResource children of that component.

Important! We only walk through ComponentResources. They’re the only resources that serve as an aggregation of other primitive (i.e. custom) resources. While a custom resource can be a parent of other resources, we don’t want to ever depend on those child resource. If we do, it’s simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it.

An example of how this would be bad is:

    var c1 = new CustomResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.id }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.id }, { parent: c1 });

The problem here is that ‘c2’ has a data dependency on ‘c1’. If it tries to wait on ‘c1’ it will walk to the children and wait on them. This will mean it will wait on ‘c3’. But ‘c3’ will be waiting in the same manner on ‘c2’, and a cycle forms.

This normally does not happen with ComponentResources as they do not have any data flowing into them. The only way you would be able to have a problem is if you had this sort of coding pattern:

    var c1 = new ComponentResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.urn }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.urn }, { parent: c1 });

However, this would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it’s acceptable if that sort of pattern failed in practice.

property __parentResource

public __parentResource: Resource | undefined;

The optional parent of this resource.

property __pulumiCustomResource

public __pulumiCustomResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property __pulumiResource

public __pulumiResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property id

public id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

public urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ProviderResource

extends CustomResource

ProviderResource is a resource that implements CRUD operations for other custom resources. These resources are managed similarly to other resources, including the usual diffing and update semantics.

constructor

new ProviderResource(pkg: string, name: string, props?: Inputs, opts: ResourceOptions)

Creates and registers a new provider resource for a particular package.

  • pkg The package associated with this provider.
  • name The unique name of the provider.
  • props The configuration to use for this provider.
  • opts A bag of options that control this provider's behavior.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property __childResources

public __childResources: Set<Resource> | undefined;

The child resources of this resource. We use these (only from a ComponentResource) to allow code to dependOn a ComponentResource and have that effectively mean that it is depending on all the CustomResource children of that component.

Important! We only walk through ComponentResources. They’re the only resources that serve as an aggregation of other primitive (i.e. custom) resources. While a custom resource can be a parent of other resources, we don’t want to ever depend on those child resource. If we do, it’s simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it.

An example of how this would be bad is:

    var c1 = new CustomResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.id }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.id }, { parent: c1 });

The problem here is that ‘c2’ has a data dependency on ‘c1’. If it tries to wait on ‘c1’ it will walk to the children and wait on them. This will mean it will wait on ‘c3’. But ‘c3’ will be waiting in the same manner on ‘c2’, and a cycle forms.

This normally does not happen with ComponentResources as they do not have any data flowing into them. The only way you would be able to have a problem is if you had this sort of coding pattern:

    var c1 = new ComponentResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.urn }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.urn }, { parent: c1 });

However, this would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it’s acceptable if that sort of pattern failed in practice.

property __parentResource

public __parentResource: Resource | undefined;

The optional parent of this resource.

property __pulumiCustomResource

public __pulumiCustomResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property __pulumiResource

public __pulumiResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property id

public id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property urn

public urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Resource

Resource represents a class whose CRUD operations are implemented by a provider plugin.

constructor

new Resource(t: string, name: string, custom: boolean, props: Inputs, opts: ResourceOptions)

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. dependsOn is an optional list of other resources that this resource depends on, controlling the order in which we perform resource operations.

  • t The type of the resource.
  • name The unique name of the resource.
  • custom True to indicate that this is a custom resource, managed by a plugin.
  • props The arguments to use to populate the new resource.
  • opts A bag of options that control this resource's behavior.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

property __childResources

public __childResources: Set<Resource> | undefined;

The child resources of this resource. We use these (only from a ComponentResource) to allow code to dependOn a ComponentResource and have that effectively mean that it is depending on all the CustomResource children of that component.

Important! We only walk through ComponentResources. They’re the only resources that serve as an aggregation of other primitive (i.e. custom) resources. While a custom resource can be a parent of other resources, we don’t want to ever depend on those child resource. If we do, it’s simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it.

An example of how this would be bad is:

    var c1 = new CustomResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.id }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.id }, { parent: c1 });

The problem here is that ‘c2’ has a data dependency on ‘c1’. If it tries to wait on ‘c1’ it will walk to the children and wait on them. This will mean it will wait on ‘c3’. But ‘c3’ will be waiting in the same manner on ‘c2’, and a cycle forms.

This normally does not happen with ComponentResources as they do not have any data flowing into them. The only way you would be able to have a problem is if you had this sort of coding pattern:

    var c1 = new ComponentResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.urn }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.urn }, { parent: c1 });

However, this would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it’s acceptable if that sort of pattern failed in practice.

property __parentResource

public __parentResource: Resource | undefined;

The optional parent of this resource.

property __pulumiResource

public __pulumiResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property urn

public urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ResourceError

extends Error

ResourceError can be used for terminating a program abruptly, specifically associating the problem with a Resource. Depending on the nature of the problem, clients can choose whether or not a call stack should be returned as well. This should be very rare, and would only indicate no usefulness of presenting that stack to the user.

constructor

new ResourceError(message: string, resource: Resource | undefined, hideStack?: undefined | false | true)

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of a ResourceError. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property Error

static Error: ErrorConstructor;

property __pulumResourceError

public __pulumResourceError: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property hideStack

public hideStack?: undefined | false | true;

property message

message: string;

property name

name: string;

property resource

public resource: Resource | undefined;

property stack

stack?: undefined | string;

class RunError

extends Error

RunError can be used for terminating a program abruptly, but resulting in a clean exit rather than the usual verbose unhandled error logic which emits the source program text and complete stack trace. This type should be rarely used. Ideally ResourceError should always be used so that as many errors as possible can be associated with a Resource.

constructor

new RunError(message: string)

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of a RunError. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property Error

static Error: ErrorConstructor;

property __pulumiRunError

public __pulumiRunError: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property message

message: string;

property name

name: string;

property stack

stack?: undefined | string;

class StackReference

extends CustomResource

Manages a reference to a Pulumi stack. The referenced stack’s outputs are available via the outputs property or the output method.

constructor

new StackReference(name: string, args?: StackReferenceArgs, opts?: CustomResourceOptions)

Create a StackReference resource with the given unique name, arguments, and options.

If args is not specified, the name of the referenced stack will be the name of the StackReference resource.

  • name The unique name of the stack reference.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method getOutput

public getOutput(name: Input<string>): Output<any>

Fetches the value of the named stack output.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property __childResources

public __childResources: Set<Resource> | undefined;

The child resources of this resource. We use these (only from a ComponentResource) to allow code to dependOn a ComponentResource and have that effectively mean that it is depending on all the CustomResource children of that component.

Important! We only walk through ComponentResources. They’re the only resources that serve as an aggregation of other primitive (i.e. custom) resources. While a custom resource can be a parent of other resources, we don’t want to ever depend on those child resource. If we do, it’s simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it.

An example of how this would be bad is:

    var c1 = new CustomResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.id }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.id }, { parent: c1 });

The problem here is that ‘c2’ has a data dependency on ‘c1’. If it tries to wait on ‘c1’ it will walk to the children and wait on them. This will mean it will wait on ‘c3’. But ‘c3’ will be waiting in the same manner on ‘c2’, and a cycle forms.

This normally does not happen with ComponentResources as they do not have any data flowing into them. The only way you would be able to have a problem is if you had this sort of coding pattern:

    var c1 = new ComponentResource("c1");
    var c2 = new CustomResource("c2", { parentId: c1.urn }, { parent: c1 });
    var c3 = new CustomResource("c3", { parentId: c1.urn }, { parent: c1 });

However, this would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it’s acceptable if that sort of pattern failed in practice.

property __parentResource

public __parentResource: Resource | undefined;

The optional parent of this resource.

property __pulumiCustomResource

public __pulumiCustomResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property __pulumiResource

public __pulumiResource: boolean = true;

A private field to help with RTTI that works in SxS scenarios.

property id

public id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: Output<string>;

The name of the referenced stack.

property outputs

public outputs: Output<{[name: string]: any}>;

The outputs of the referenced stack.

property urn

public urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

const deploymentOnlyModule

const deploymentOnlyModule: true = true;

const testingOptions

let isDryRun

let isDryRun: boolean = false;

const version

const version: "${VERSION}" = "${VERSION}";

function all

all<T>(val: Record<string, Input<T>>): Output<Record<string, Unwrap<T>>>

Allows for multiple Output objects to be combined into a single Output object. The single Output will depend on the union of Resources that the individual dependencies depend on.

This can be used in the following manner:

var d1: Output<string>;
var d2: Output<number>;

var d3: Output<ResultType> = Output.all([d1, d2]).apply(([s, n]) => ...);

In this example, taking a dependency on d3 means a resource will depend on all the resources of d1 and d2.

all<T1,T2,T3,T4,T5,T6,T7,T8>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined, Input<T4> | undefined, Input<T5> | undefined, Input<T6> | undefined, Input<T7> | undefined, Input<T8> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>, Unwrap<T4>, Unwrap<T5>, Unwrap<T6>, Unwrap<T7>, Unwrap<T8>]>
all<T1,T2,T3,T4,T5,T6,T7>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined, Input<T4> | undefined, Input<T5> | undefined, Input<T6> | undefined, Input<T7> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>, Unwrap<T4>, Unwrap<T5>, Unwrap<T6>, Unwrap<T7>]>
all<T1,T2,T3,T4,T5,T6>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined, Input<T4> | undefined, Input<T5> | undefined, Input<T6> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>, Unwrap<T4>, Unwrap<T5>, Unwrap<T6>]>
all<T1,T2,T3,T4,T5>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined, Input<T4> | undefined, Input<T5> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>, Unwrap<T4>, Unwrap<T5>]>
all<T1,T2,T3,T4>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined, Input<T4> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>, Unwrap<T4>]>
all<T1,T2,T3>(values: [, Input<T1> | undefined, Input<T2> | undefined, Input<T3> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>, Unwrap<T3>]>
all<T1,T2>(values: [, Input<T1> | undefined, Input<T2> | undefined]): Output<[, Unwrap<T1>, Unwrap<T2>]>
all<T>(ds: undefined | T | Promise<T> | OutputInstance<T>[]): Output<Unwrap<T>[]>

function concat

concat(params: Input<any>[]): Output<string>

[concat] takes a sequence of [Inputs], stringifies each, and concatenates all values into one final string. Individual inputs can be any sort of [Input] value. i.e. they can be [Promise]s, [Output]s, or just plain JavaScript values. This can be used like so:

     // 'server' and 'loadBalancer' are both resources that expose [Output] properties.
     let val: Output<string> = pulumi.concat("http://", server.hostname, ":", loadBalancer.port);

function getProject

getProject(): string

getProject returns the current project name. It throws an exception if none is registered.

function getStack

getStack(): string

getStack returns the current stack name. It throws an exception if none is registered.

function hasTrueBooleanMember

hasTrueBooleanMember(obj: any, memberName: string | number | symbol): boolean

function interpolate

interpolate(literals: TemplateStringsArray, placeholders: Input<any>[]): Output<string>

[interpolate] is similar to [concat] but is designed to be used as a tagged template expression. i.e.:

     // 'server' and 'loadBalancer' are both resources that expose [Output] properties.
     let val: Output<string> = pulumi.interpolate `http://${server.hostname}:${loadBalancer.port}`

As with [concat] the ‘placeholders’ between ${} can be any Inputs. i.e. they can be [Promise]s, [Output]s, or just plain JavaScript values.

function isInstance

isInstance<T>(obj: any, name: keyof T): boolean

function output

output<T>(val: Input<T>): Output<Unwrap<T>>

[output] takes any Input value and converts it into an Output, deeply unwrapping nested Input values as necessary.

The expected way to use this function is like so:

     var transformed = pulumi.output(someVal).apply(unwrapped => {
         // Do whatever you want now.  'unwrapped' will contain no outputs/promises inside
         // here, so you can easily do whatever sort of transformation is most convenient.
     });

     // the result can be passed to another Resource.  The dependency information will be
     // properly maintained.
     var someResource = new SomeResource(name, { data: transformed ... });
output<T>(val: Input<T> | undefined): Output<Unwrap<T | undefined>>

interface ComponentResourceOptions

extends ResourceOptions

ComponentResourceOptions is a bag of optional settings that control a component resource’s behavior.

property dependsOn

dependsOn?: Input<Input<Resource>[]> | Input<Resource>;

An optional additional explicit dependencies on other resources.

property id

id?: Input<ID>;

An optional existing ID to load, rather than create.

property parent

parent?: Resource;

An optional parent resource to which this resource belongs.

property protect

protect?: undefined | false | true;

When set to true, protect ensures this resource cannot be deleted.

property providers

providers?: Record<string, ProviderResource>;

An optional set of providers to use for child resources. Keyed by package name (e.g. “aws”)

interface CustomResourceOptions

extends ResourceOptions

CustomResourceOptions is a bag of optional settings that control a custom resource’s behavior.

property deleteBeforeReplace

deleteBeforeReplace?: undefined | false | true;

When set to true, deleteBeforeReplace indicates that this resource should be deleted before its replacement is created when replacement is necessary.

property dependsOn

dependsOn?: Input<Input<Resource>[]> | Input<Resource>;

An optional additional explicit dependencies on other resources.

property id

id?: Input<ID>;

An optional existing ID to load, rather than create.

property parent

parent?: Resource;

An optional parent resource to which this resource belongs.

property protect

protect?: undefined | false | true;

When set to true, protect ensures this resource cannot be deleted.

property provider

provider?: ProviderResource;

An optional provider to use for this resource’s CRUD operations. If no provider is supplied, the default provider for the resource’s package will be used. The default provider is pulled from the parent’s provider bag (see also ComponentResourceOptions.providers).

interface OutputConstructor

Static side of the [Output] type. Can be used to [create] Outputs as well as test arbitrary values to see if they are [Output]s.

constructor

new OutputConstructor<T>(resources: Set<Resource> | Resource[] | Resource, promise: Promise<T>, isKnown: Promise<boolean>)

method create

create<T>(val: Input<T>): Output<Unwrap<T>>
create<T>(val: Input<T> | undefined): Output<Unwrap<T | undefined>>

method isInstance

isInstance<T>(obj: any): boolean

interface OutputInstance

Instance side of the [Output] type. Exposes the deployment-time and run-time mechanisms for working with the underlying value of an [Output].

method apply

apply<U>(func: (t: T) => Promise<U>): Output<U>

Transforms the data of the output with the provided func. The result remains a Output so that dependent resources can be properly tracked.

‘func’ is not allowed to make resources.

‘func’ can return other Outputs. This can be handy if you have a Output and you want to get a transitive dependency of it. i.e.

var d1: Output<SomeVal>;
var d2 = d1.apply(v => v.x.y.OtherOutput); // getting an output off of 'v'.

In this example, taking a dependency on d2 means a resource will depend on all the resources of d1. It will not depend on the resources of v.x.y.OtherDep.

Importantly, the Resources that d2 feels like it will depend on are the same resources as d1. If you need have multiple Outputs and a single Output is needed that combines both set of resources, then ‘pulumi.all’ should be used instead.

This function will only be called execution of a ‘pulumi update’ request. It will not run during ‘pulumi preview’ (as the values of resources are of course not known then). It is not available for functions that end up executing in the cloud during runtime. To get the value of the Output during cloud runtime execution, use get().

apply<U>(func: (t: T) => OutputInstance<U>): Output<U>
apply<U>(func: (t: T) => U): Output<U>

method get

get(): T

Retrieves the underlying value of this dependency.

This function is only callable in code that runs in the cloud post-deployment. At this point all Output values will be known and can be safely retrieved. During pulumi deployment or preview execution this must not be called (and will throw). This is because doing so would allow Output values to flow into Resources while losing the data that would allow the dependency graph to be changed.

method promise

promise(): Promise<T>

method resources

resources(): Set<Resource>

property isKnown

isKnown: Promise<boolean>;

interface ResourceOptions

ResourceOptions is a bag of optional settings that control a resource’s behavior.

property dependsOn

dependsOn?: Input<Input<Resource>[]> | Input<Resource>;

An optional additional explicit dependencies on other resources.

property id

id?: Input<ID>;

An optional existing ID to load, rather than create.

property parent

parent?: Resource;

An optional parent resource to which this resource belongs.

property protect

protect?: undefined | false | true;

When set to true, protect ensures this resource cannot be deleted.

interface StackReferenceArgs

The set of arguments for constructing a StackReference resource.

property name

name?: Input<string>;

The name of the stack to reference.

interface UnwrappedArray

extends Array<Unwrap<T>>

method __@iterator

__@iterator(): IterableIterator<Unwrap<T>>

Iterator

method __@unscopables

__@unscopables(): {
    copyWithin: boolean;
    entries: boolean;
    fill: boolean;
    find: boolean;
    findIndex: boolean;
    keys: boolean;
    values: boolean;
}

Returns an object whose properties have the value ‘true’ when they will be absent when used in a ‘with’ statement.

method concat

concat(items: ConcatArray<Unwrap<T>>[]): Unwrap<T>[]

Combines two or more arrays.

concat(items: T | ConcatArray<T>[]): Unwrap<T>[]

Combines two or more arrays.

method copyWithin

copyWithin(target: number, start: number, end?: undefined | number): this

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

method entries

entries(): IterableIterator<[, number, Unwrap<T>]>

Returns an iterable of key, value pairs for every entry in the array

method every

every(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => boolean, thisArg?: any): boolean

Determines whether all the members of an array satisfy the specified test.

method fill

fill(value: Unwrap<T>, start?: undefined | number, end?: undefined | number): this

Returns the this object after filling the section identified by start and end with value

method filter

filter<S>(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => boolean, thisArg?: any): S[]

Returns the elements of an array that meet the condition specified in a callback function.

filter(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => any, thisArg?: any): Unwrap<T>[]

Returns the elements of an array that meet the condition specified in a callback function.

method find

find<S>(predicate: (this: void, value: Unwrap<T>, index: number, obj: Unwrap<T>[]) => boolean, thisArg?: any): S | undefined

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

find(predicate: (value: Unwrap<T>, index: number, obj: Unwrap<T>[]) => boolean, thisArg?: any): Unwrap<T> | undefined

method findIndex

findIndex(predicate: (value: Unwrap<T>, index: number, obj: Unwrap<T>[]) => boolean, thisArg?: any): number

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

method forEach

forEach(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => void, thisArg?: any): void

Performs the specified action for each element in an array.

method indexOf

indexOf(searchElement: Unwrap<T>, fromIndex?: undefined | number): number

Returns the index of the first occurrence of a value in an array.

method join

join(separator?: undefined | string): string

Adds all the elements of an array separated by the specified separator string.

method keys

keys(): IterableIterator<number>

Returns an iterable of keys in the array

method lastIndexOf

lastIndexOf(searchElement: Unwrap<T>, fromIndex?: undefined | number): number

Returns the index of the last occurrence of a specified value in an array.

method map

map<U>(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => U, thisArg?: any): U[]

Calls a defined callback function on each element of an array, and returns an array that contains the results.

method pop

pop(): Unwrap<T> | undefined

Removes the last element from an array and returns it.

method push

push(items: Unwrap<T>[]): number

Appends new elements to an array, and returns the new length of the array.

method reduce

reduce(callbackfn: (previousValue: Unwrap<T>, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => Unwrap<T>): Unwrap<T>

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduce(callbackfn: (previousValue: Unwrap<T>, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => Unwrap<T>, initialValue: Unwrap<T>): Unwrap<T>
reduce<U>(callbackfn: (previousValue: U, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

method reduceRight

reduceRight(callbackfn: (previousValue: Unwrap<T>, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => Unwrap<T>): Unwrap<T>

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduceRight(callbackfn: (previousValue: Unwrap<T>, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => Unwrap<T>, initialValue: Unwrap<T>): Unwrap<T>
reduceRight<U>(callbackfn: (previousValue: U, currentValue: Unwrap<T>, currentIndex: number, array: Unwrap<T>[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

method reverse

reverse(): Unwrap<T>[]

Reverses the elements in an Array.

method shift

shift(): Unwrap<T> | undefined

Removes the first element from an array and returns it.

method slice

slice(start?: undefined | number, end?: undefined | number): Unwrap<T>[]

Returns a section of an array.

method some

some(callbackfn: (value: Unwrap<T>, index: number, array: Unwrap<T>[]) => boolean, thisArg?: any): boolean

Determines whether the specified callback function returns true for any element of an array.

method sort

sort(compareFn?: undefined | (a: Unwrap<T>, b: Unwrap<T>) => number): this

Sorts an array.

method splice

splice(start: number, deleteCount?: undefined | number): Unwrap<T>[]

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

splice(start: number, deleteCount: number, items: Unwrap<T>[]): Unwrap<T>[]

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

method toLocaleString

toLocaleString(): string

Returns a string representation of an array. The elements are converted to string using their toLocalString methods.

method toString

toString(): string

Returns a string representation of an array.

method unshift

unshift(items: Unwrap<T>[]): number

Inserts new elements at the start of an array.

method values

values(): IterableIterator<Unwrap<T>>

Returns an iterable of values in the array

property Array

Array: ArrayConstructor;

property length

length: number;

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

type ID

type ID = string;

type Input

type Input = T | Promise<T> | OutputInstance<T>;

[Input] is a property input for a resource. It may be a promptly available T, a promise for one, or the output from a existing Resource.

type Inputs

type Inputs = Record<string, Input<any>>;

[Inputs] is a map of property name to property input, one for each resource property value.

type Lifted

type Lifted = Lifted;</pre>

The [Lifted] type allows us to express the operation of taking a type, with potentially deeply
nested objects and arrays and to then get a type with the same properties, except whose property
types are now [Output]s of the original property type.

For example:


     `type X = { A: string, B: { c: boolean } }`

Then `Lifted` would be equivalent to:

     `...    = { A: Output, B: Output<{ C: Output }> }`

[Lifted] is somewhat the opposite of [Unwrap].  It's primary purpose is to allow an instance of
[Output] to provide simple access to the properties of [SomeType] directly on the instance
itself (instead of haveing to use [.apply]).

This lifting only happens through simple pojo objects and arrays.  Functions, for example, are not
lifted.  So you cannot do:

```ts
     const o: Output = ...;
     const c: Output = o.charCodeAt(0);
```

Instead, you still need to write;

```ts
     const o: Output = ...;
     const c: Output = o.apply(v => v.charCodeAt(0));
```

</div>

type LiftedArray

type LiftedArray = {
    length: Output<number>;
};

type LiftedObject

type LiftedObject = { ... };

type Output

type Output = OutputInstance<T> & Lifted<T>;

[Output] helps encode the relationship between Resources in a Pulumi application. Specifically an [Output] holds onto a piece of Data and the Resource it was generated 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 ‘Resource dependency graph’ to be created, which properly tracks the relationship between resources.

An [Output] is used in a Pulumi program differently depending on if the application is executing at ‘deployment time’ (i.e. when actually running the ‘pulumi’ executable), or at ‘run time’ (i.e. a piece of code running in some Cloud).

At ‘deployment time’, the correct way to work with the underlying value is to call [Output.apply(func)]. This allows the value to be accessed and manipulated, while still resulting in an [Output] that is keeping track of [Resource]s appropriately. At deployment time the underlying value may or may not exist (for example, if a preview is being performed). In this case, the ‘func’ callback will not be executed, and calling [.apply] will immediately return an [Output] that points to the [undefined] value. During a normal [update] though, the ‘func’ callbacks should always be executed.

At ‘run time’, the correct way to work with the underlying value is to simply call [Output.get] which will be promptly return the entire value. This will be a simple JavaScript object that can be manipulated as necessary.

To ease with using [Output]s at ‘deployment time’, pulumi will ‘lift’ simple data properties of an underlying value to the [Output] itself. For example:

     const o: Output<{ name: string, age: number, orders: Order[] }> = ...;
     const name : Output<string> = o.name;
     const age  : Output<number> = o.age;
     const first: Output<Order>  = o.orders[0];

Instead of having to write:

     const o: Output<{ name: string, age: number, orders: Order[] }> = ...;
     const name : Output<string> = o.apply(v => v.name);
     const age  : Output<number> = o.apply(v => v.age);
     const first: Output<Order> = o.apply(v => v.orders[0]);

type URN

type URN = string;

type Unwrap

type Unwrap = Unwrap;</pre>

The 'Unwrap' type allows us to express the operation of taking a type, with potentially deeply
nested Promises and Outputs and to then get that same type with all the Promises and Outputs
replaced with their wrapped type.  Note that this Unwrapping is 'deep'.  So if you had:

     `type X = { A: Promise<{ B: Output<{ c: Input }> }> }`

Then `Unwrap` would be equivalent to:

     `...    = { A: { B: { C: boolean } } }`

Unwrapping sees through Promises, Outputs, Arrays and Objects.

Note: due to TypeScript limitations there are some things that cannot be expressed. Specifically,
if you had a `Promise<Output>` then the Unwrap type would not be able to undo both of those
wraps. In practice that should be ok.  Values in an object graph should not wrap Outputs in
Promises.  Instead, any code that needs to work Outputs and also be async should either create
the Output with the Promise (which will collapse into just an Output).  Or, it should start with
an Output and call [apply] on it, passing in an async function.  This will also collapse and just
produce an Output.

In other words, this should not be used as the shape of an object: `{ a: Promise<Output<...>> }`.
It should always either be `{ a: Promise }` or just `{ a: Output<...> }`.

</div>

type UnwrapSimple

type UnwrapSimple = UnwrapSimple;</pre>

Handles encountering basic types when unwrapping.

</div>

type UnwrappedObject

type UnwrappedObject = { ... };