Hi Team - I have a quick question - Is there a way...
# general
t
Hi Team - I have a quick question - Is there a way I can access Pulumi state (to get the exact ARNs/Configuration) from my application code? for example when I create a DynamoDB it creates a unique ARN, I need that ARN in my application code - What is hte best practice
l
If you created a DynamoDB
Table
using Pulumi, use the
arn
property and pass this value to the Pulumi code which deploys your application. https://www.pulumi.com/registry/packages/aws/api-docs/dynamodb/table/#arn_nodejs
l
The state is JSON, so you can pull it and parse it, but it would be easier to use
pulumi stack output...
or similar.
You can use automation api for this, but there's fewer dependencies if you just run the command via exec or similar.
t
Hi - I want to do it programtically
my application code is in nodejs and my infra code is in Python
I am creating a landing zone with python/pulumi and what ever ARNs are created, I want to pass to my application code..what is the best practice
l
I think in that case, since your application can be running months / weeks after the most recent deployment, you should store the values in the cloud. DynamoDB, Hashicorp Vault, SSM Parameters, something like that. You can write the correct values during deployment, and read them any time thereafter.