Hi, can we set config from code?? I found Config.g...
# getting-started
s
Hi, can we set config from code?? I found Config.get but didn’t see Config.set
l
Config is for changing the way the code works. Config.set would amount to self-modifying code.
No, there is no Config.set. Config is read-only within the context of a Pulumi program.
s
ok. I want to store variables to a stack. How can I do it??
l
Export is as an output.
I suppose it depends on the context. Where do you want to be able to retrieve this value?
s
I am provisioning postgres. I put table definitions in a folder: 00-initialize.sql 01-update1.sql 02-update2.sql and execute them from code.
I want to store the number such as 02. so when next time I run pulumi up if I see a new file 03-xxx.sql 04-xxx.sql I will execute them
otherwise I will skip files already excuted.
l
No, that's not what Pulumi is for.
You can do it in a Pulumi program, but you've got to write that sort of code yourself.
If you want to store it, you can either manually set it in your config, or write it to a vault or similar.
But ideally, you would use a different tool/library to do that, one better suited to the job.
s
oh, I c.
did “vault” here mean something like aws.appconfig ?
l
Like SSM Parameters, Hashicorp Vault, or any other persistent cloud-based store for values.
Could even use DynamoDB I guess..
s
gotch. I will check them. Thank you so much!!!