https://pulumi.com logo
Title
c

cold-cpu-48402

12/04/2022, 9:12 AM
Hi, I find it kinda odd that ec2 user data won’t accept a file asset. Am I missing something?
b

billowy-army-68599

12/04/2022, 5:32 PM
user data is just a string, a file asset is a binary zip file. Why do you need to send a file asset?
c

cold-cpu-48402

12/04/2022, 6:52 PM
well, it's extremely convenient to have them as shell files (which they basically are). Even when working with terraform files, I usually load them as separate files. The scenario where I'll work with one as a multiline string is quite rare.
b

billowy-army-68599

12/04/2022, 6:53 PM
You can read the file from the file system into a string, you just can’t use FileAsset
I’ll send an example in a few mins
Which language are you using?
c

cold-cpu-48402

12/04/2022, 6:54 PM
I worked it out, it's just 'model breaking' - I want to collect my pulumi project logically. Restricting file assets to binary content may be a correct technical motivation but seems counterproductive from a utility point of view. same with other text contents like IAM policies.
b

billowy-army-68599

12/04/2022, 6:56 PM
You can absolutely do that, it’s just the FileAsset resource that has specific implementation details.
c

cold-cpu-48402

12/04/2022, 6:57 PM
oh well 🙂 we still have that other thread which is a bit more interesting to me
m

modern-evening-83482

02/03/2023, 7:09 PM
@billowy-army-68599 do you have an example of doing this? Is it just reading the file and adding the string?