https://pulumi.com logo
#general
Title
# general
f

fast-pilot-57307

03/07/2024, 4:14 PM
In general I have noticed the Pulumi AI and the docs always export at the end of the deployment script. Is this best practice and why? I have found that putting my export statements after declaring the resource to be helpful as I don’t have to remember to do it later.
d

dry-keyboard-94795

03/07/2024, 4:36 PM
Both approaches are valid. I found there's not a huge amount of benefit to centralising exports in code as it's easy to find them through the cli. However it does mean that added logic relating to exports is kept away from the code relating to setting up resources. For the most part, I exported close to where the resource/config is loaded too