:wave: Hey folks, this may be a trivial question b...
# python
h
👋 Hey folks, this may be a trivial question but I haven't been able to find an answer or example online. Is it possible / how do I access a pulumi resources output from a different file in the same project? For example:
Copy code
❯ ls -la
drwxr-xr-x   9 wsheldon  staff    288 Jan 20 16:26 .
drwxr-xr-x  10 wsheldon  staff    320 Jan 20 16:30 ..
-rw-r--r--   1 wsheldon  staff  20709 Feb 18 15:46 __main__.py
drwxr-xr-x   3 wsheldon  staff     96 Feb 18 15:46 __pycache__
drwxr-xr-x   4 wsheldon  staff    128 Dec 29 08:56 docker
-rw-r--r--   1 wsheldon  staff    978 Jan 20 16:05 ecr.py
-rw-r--r--   1 wsheldon  staff   9516 Jan 20 16:05 iam.py
-rw-r--r--   1 wsheldon  staff   4368 Jan 20 15:51 s3.py
-rw-r--r--   1 wsheldon  staff   9944 Jan 20 16:05 vpc.py
How would one access
s3_bucket.id
in the
s3.py
file, from the
__main__.py
file
s
create functions that are imported into
__main__.py
and then called to create the resources, they can then be returned to be used elsewhere. Here's an example layout of one of my projects
p
Even better than functions would be component resources. There are multiple examples in pulumi/examples repo, e.g. here or here.