What would be a good practice on "exporting" ARNs ...
# general
r
What would be a good practice on "exporting" ARNs from created resource, especially for multiple projects within single repo? For example, a few roles are created in the
iam
project. They are later used by
infra
project.
b
then use a stack reference in the infra project: https://www.pulumi.com/learn/building-with-pulumi/stack-references/
s
r
👍 thanks both!
May I ask for advice on exporting a dict in Python?
Copy code
iac_admin_role_arns = {}
    for account in ACCOUNTS:
        iac_admin_role_arns[str(account)] = <role arn Output>
    
    pulumi.export("iac-admin-role-arns", iac_admin_role_arns)
This throws:
Copy code
k: await serialize_property(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/dennispan/code/iac/iam/venv/lib/python3.11/site-packages/pulumi/runtime/rpc.py", line 562, in serialize_property
        raise ValueError(f"unexpected input of type {type(value).__name__}")
    ValueError: unexpected input of type dict_values
b
this looks like you’re trying to add an output to a dict of string, rather than an export problem
r
Ah indeed. It was actually caused by
.values()
on the dict and passed that to where a
list
is expected. Thanks for taking a look!