better-lunch-24345
04/29/2024, 1:09 PMgcp.serviceaccount.IAMMember
that accepts multiple roles like from a list like this ['roles/iam.serviceAccountUser', 'roles/storage.admin']
? Using typescript btw.
Every time I try to add something like that I see this error. But I would like to have a module it can be reused, and providing a list I can reuse that for many purposes.
error: gcp:serviceaccount/iAMMember:IAMMember resource 'prod-sa-runner' has a problem: Attribute must be a single value, not a list. Examine values at 'prod-sa-runner.role'.
dry-keyboard-94795
04/29/2024, 1:32 PMbetter-lunch-24345
04/29/2024, 1:34 PMdry-keyboard-94795
04/29/2024, 1:38 PMroles.forEach(r => IAMMember(`prod-sa-runner-${r}`, {
role: r,
serviceAccountId: sa.id,
...
});
For the resource name, you'll need to slugify the role being passed in to avoid special characters like ':' and '/'better-lunch-24345
04/29/2024, 1:59 PM