Module dynamic




Resource Resource

class Resource extends CustomResource

Resource represents a Pulumi Resource that incorporates an inline implementation of the Resource’s CRUD operations.


new Resource(provider: ResourceProvider, name: string, props: Inputs, opts?: resource.CustomResourceOptions, module?: undefined | string, type: string)

Creates a new dynamic resource.

  • provider The implementation of the resource's CRUD operations.
  • name The name of the resource.
  • props The arguments to use to populate the new resource. Must not define the reserved property "__provider".
  • opts A bag of options that control this resource's behavior.
  • module The module of the resource.
  • type The type of the resource.

method getProvider

public getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is CustomResource

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


interface CheckFailure

interface CheckFailure

CheckFailure represents a single failure in the results of a call to ResourceProvider.check

property property

property: string;

The property that failed validation.

property reason

reason: string;

The reason that the property failed validation.

interface CheckResult

interface CheckResult

CheckResult represents the results of a call to ResourceProvider.check.

property failures

failures?: CheckFailure[];

Any validation failures that occurred.

property inputs

inputs?: Inputs;

The inputs to use, if any.

interface CreateResult

interface CreateResult

CreateResult represents the results of a call to ResourceProvider.create.

property id

id: resource.ID;

The ID of the created resource.

property outs

outs?: Outputs;

Any properties that were computed during creation.

interface DiffResult

interface DiffResult

DiffResult represents the results of a call to ResourceProvider.diff.

property changes

changes?: undefined | false | true;

If true, this diff detected changes and suggests an update.

property deleteBeforeReplace

deleteBeforeReplace?: undefined | false | true;

If true, and a replacement occurs, the resource will first be deleted before being recreated. This is to void potential side-by-side issues with the default create before delete behavior.

property replaces

replaces?: string[];

If this update requires a replacement, the set of properties triggering it.

property stables

stables?: string[];

An optional list of properties that will not ever change.

interface ReadResult

interface ReadResult

property id

id?: resource.ID;

The ID of the resource ready back (or blank if missing).

property props

props?: Outputs;

The current property state read from the live environment.

interface ResourceProvider

interface ResourceProvider

ResourceProvider represents an object that provides CRUD operations for a particular type of resource.

property check

check?: undefined | (olds: Inputs, news: Inputs) => Promise<CheckResult<Inputs>>;

Check validates that the given property bag is valid for a resource of the given type.

property create

create: (inputs: Inputs) => Promise<CreateResult<Outputs>>;

Create allocates a new instance of the provided resource and returns its unique ID afterwards. If this call fails, the resource must not have been created (i.e., it is “transactional”).

property delete

delete?: undefined | (id: resource.ID, props: Outputs) => Promise<void>;

Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.

property diff

diff?: undefined | (id: resource.ID, olds: Outputs, news: Inputs) => Promise<DiffResult>;

Diff checks what impacts a hypothetical update will have on the resource’s properties.

property read

read?: undefined | (id: resource.ID, props?: Outputs) => Promise<ReadResult<Outputs>>;

Reads the current live state associated with a resource. Enough state must be included in the inputs to uniquely identify the resource; this is typically just the resource ID, but it may also include some properties.

property update

update?: undefined | (id: resource.ID, olds: Outputs, news: Inputs) => Promise<UpdateResult<Outputs>>;

Update updates an existing resource with new values.

interface UpdateResult

interface UpdateResult

UpdateResult represents the results of a call to ResourceProvider.update.

property outs

outs?: Outputs;

Any properties that were computed during updating.