pulumi / pulumi-ai

225 stars 16 forks source link

[AI Answers] What is the process to cause a delay during resource creation in code in C# #98

Open davecluderay opened 3 months ago

davecluderay commented 3 months ago

Affected page: What is the process to cause a delay during resource creation in code in C#

This page is advising the use of C# Task.Delay to introduce a delay during resource creation.

That advice seems bad, because it will create an indiscriminate delay whenever a stack operation such as preview or up is performed (and even when nothing needs to change).

Since Pulumi already has the Pulumiverse.Time provider for this purpose, this would be the more correct answer (it allows the sleep to be specified on resource creation, resource destruction, or both, and will only apply at those points in the resource lifecycle).