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

thankful-father-68341

12/06/2021, 12:44 PM
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

limited-rainbow-51650

12/06/2021, 2:05 PM
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

little-cartoon-10569

12/06/2021, 8:28 PM
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

thankful-father-68341

12/08/2021, 4:37 PM
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

little-cartoon-10569

12/09/2021, 12:57 AM
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.