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.
providerThe implementation of the resource's CRUD operations.
nameThe name of the resource.
propsThe arguments to use to populate the new resource. Must not define the reserved property "__provider".
optsA bag of options that control this resource's behavior.
moduleThe module of the resource.
typeThe type of the resource.
public getProvider(moduleMember: string): ProviderResource | undefined
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.
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.
public urn: Output<URN>;
urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
CheckFailure represents a single failure in the results of a call to
The property that failed validation.
The reason that the property failed validation.
CheckResult represents the results of a call to
Any validation failures that occurred.
The inputs to use, if any.
CreateResult represents the results of a call to
The ID of the created resource.
Any properties that were computed during creation.
DiffResult represents the results of a call to
changes?: undefined | false | true;
If true, this diff detected changes and suggests an update.
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.
If this update requires a replacement, the set of properties triggering it.
An optional list of properties that will not ever change.
The ID of the resource ready back (or blank if missing).
The current property state read from the live environment.
ResourceProvider represents an object that provides CRUD operations for a particular type of resource.
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.
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”).
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.
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.
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.
update?: undefined | (id: resource.ID, olds: Outputs, news: Inputs) => Promise<UpdateResult<Outputs>>;
Update updates an existing resource with new values.
UpdateResult represents the results of a call to
Any properties that were computed during updating.