I had a similar issue and asked this question
https://pulumi-community.slack.com/archives/C019YSXN04B/p1674121180254749. In general Pulumi encourages not to create resources in apply if possible because it may cause issues on diffs. However as can be seen from the example that I link to in the comment to my post they do so themselves when necessary, because sometimes, especially in networking resources depend on each other, so doing it in the apply is necessary. Hope this helps.