pulumi-command icon indicating copy to clipboard operation
pulumi-command copied to clipboard

Add a `local.File` resource

Open lukehoban opened this issue 2 years ago • 3 comments

There are some common cases where users want to manage a file on disk as part of local deployments. For these cases, a local.File resource could be useful. This would serve a similar use case as https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file.

This can be accomplished today via local.Command or via using file I/O in the Pulumi programming language of choice. But a local.File resource might offer a simpler and more consistent way to manage a file within the resource lifecycle.

lukehoban avatar Oct 28 '22 16:10 lukehoban

I do have interest in contributing this feature as well as this is also a need I do have and use the same workaround that is described here.

I guess, is the right place for this in this plugin? Or should this be a new plugin? I see there is a copy file functionality for 'remote' so I'll guess it could be acceptable for this functionality to exist in this plugin?

julsemaan avatar May 25 '24 19:05 julsemaan

A secondary use-case for a File resource is to be able to draw a dependency on an externally-managed file. I'd like to use a get method to read an external file, then use the file's path and/or content to configure another resource. During preview, the output properties would assumedly have unknown values.

EronWright avatar May 29 '24 17:05 EronWright