keep getting [Object object] collisions
# general
keep getting [Object object] collisions
hmm, not sure I understand the question
is the problem that you can’t write such a function at all, or that it’s not clear how to do it reliably
how to do it reliably
I create 2 service accounts
pass an array of their emails to a function that uses them to assign those 2 accounts to the same role.
It sounds like you are likely trying to use an
as a
parameter on a resource. That won’t work, and you will need to pick a name that is known up front (before the resource ultimately gets created). You can generally do this by passing a name into the code that is creating these resources, and ensuring that callers pass both the name and any `output`s that are need to initialize it. If you have code you could share, we could give more precise guidance.
export function createIamMemberFromServiceAccount( roles: string[], members: Input<string>[], project: string ) { roles.forEach(role => { members.forEach(sa => { new gcp.projects.IAMMember(
, { member: pulumi.concat("serviceAccount:", sa), project, role }); }); }); }
ok - i guess that's the issue
the account name is computed
That’s right - the
part will tostring to
[object Object]
which will not work. Suggest that callers of this pass in an explicit member name, or use the loop index instead of the Output as part of the name.
thanks Luke