This message was deleted.
# python
s
This message was deleted.
p
yeah, members are not constructed properly
If
read_sa.email
was a normal
str
that would work (f-string interpolation) but it’s actually
pulumi.Output[str]
. Try to see the details while trying to apply these changes, you should see “maltformed”
members
array.
In order to manipulate
Output
types, you have to either use `apply`:
Copy code
members = [
  read_sa.email.apply(lambda email: f"serviceAccount:{email}"),
]
or `concat`:
Copy code
members = [
  pulumi.Output.concat("serviceAccount:", read_sa.email),
]
Why? Reason is quite simple. This value is lazy evaluated and comes from a resource previously created so you have to have some kind of synchronization within the code. If you use the value directly (like you did with
py_repo.name
), there’s no need for additional “magic” - pulumi handles that automatically. However, it will break, if you do some string concatenation (using f-string or even plus sign).
l
that makes sense! Thanks @prehistoric-activity-61023!