Delegate StateMigration
StateMigration is the callback signature for the StateMigrations resource option.
This API is experimental and may change.
A callback receives the prior state of the resource and its descendants, and may return a replacement subtree for the engine to use before diffing those resources. Returning null leaves the callback's input state unchanged and allows later callbacks to run. Callbacks must be idempotent.
Migrations run during updates and previews when prior state exists, including state matched through aliases. Migrations rewrite state only, they do not create, import, or modify physical resources.
Namespace: Pulumi
Assembly: Pulumi.dll
Syntax
public delegate Task<StateMigrationResult?> StateMigration(StateMigrationArgs args, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| StateMigrationArgs | args | is the callback signature for the resource option. This API is experimental and may change. A callback receives the prior state of the resource and its descendants, and may return a replacement subtree for the engine to use before diffing those resources. Returning null leaves the callback's input state unchanged and allows later callbacks to run. Callbacks must be idempotent. Migrations run during updates and previews when prior state exists, including state matched through aliases. Migrations rewrite state only, they do not create, import, or modify physical resources. |
| CancellationToken | cancellationToken | is the callback signature for the resource option. This API is experimental and may change. A callback receives the prior state of the resource and its descendants, and may return a replacement subtree for the engine to use before diffing those resources. Returning null leaves the callback's input state unchanged and allows later callbacks to run. Callbacks must be idempotent. Migrations run during updates and previews when prior state exists, including state matched through aliases. Migrations rewrite state only, they do not create, import, or modify physical resources. |
Returns
| Type | Description |
|---|---|
| Task<StateMigrationResult> | is the callback signature for the resource option. This API is experimental and may change. A callback receives the prior state of the resource and its descendants, and may return a replacement subtree for the engine to use before diffing those resources. Returning null leaves the callback's input state unchanged and allows later callbacks to run. Callbacks must be idempotent. Migrations run during updates and previews when prior state exists, including state matched through aliases. Migrations rewrite state only, they do not create, import, or modify physical resources. |
Remarks
The callback receives plaintext secret values inside their secret envelopes and must not log or otherwise expose them. It must not perform Pulumi runtime operations or wait for unresolved Outputs. Every resource omitted from the returned state must identify a returned successor. Provider resource states must remain unchanged, and custom resources must preserve their physical identity and lifecycle safety flags.