polite-motherboard-78438
03/14/2020, 6:15 PMconst member = pulumi.interpolate`serviceAccount:${serviceAccount.email}`;
const policyData = gcp.organizations.getIAMPolicy({
bindings: [
{
role: "roles/storage.admin",
members: [member]
}
]
});
faint-table-42725
03/14/2020, 8:09 PMget
itself within an apply, e.g.
policyData = serviceAccount.email.apply(email =>
gcp.organizations.getIAMPolicy(...))
(policyData will now be an Output<GetIAMPolicyResult>
which you can use elsewherepolite-motherboard-78438
03/15/2020, 10:20 AMconst policyData = serviceAccount.email.apply(email =>
gcp.organizations.getIAMPolicy({
bindings: [
{
role: "roles/storage.admin",
members: [
"serviceAccount:" + email,
"serviceAccount:" + gcpServiceAccount
]
}
]
})
);
const bucketPolicy = new gcp.storage.BucketIAMPolicy("velero", {
bucket: bucket.id,
policyData: policyData.policyData
});
faint-table-42725
03/15/2020, 4:53 PMpulumi.all
— you might want to take a look at https://www.pulumi.com/docs/intro/concepts/programming-model/#outputs if you haven’t alreadypolite-motherboard-78438
03/21/2020, 3:54 PMpulumi.all
in the unit tests documentation today Will tryconst policyData = pulumi
.all([serviceAccount.email, gcpServiceAccount])
.apply(([veleroServiceAccount, gcpServiceAccount]) => {
gcp.organizations.getIAMPolicy({
bindings: [
{
role: "roles/storage.admin",
members: [
"serviceAccount:" + veleroServiceAccount,
"serviceAccount:" + gcpServiceAccount
]
}
]
});
});
But now policyData is an instance of pulumi.OutputInstance<void>
and not Output<GetIAMPolicyResult>
faint-table-42725
03/23/2020, 3:12 AM=> { … }
as a void function. You should remove that extra set of braces and it should give you back what you want.polite-motherboard-78438
04/18/2020, 10:23 AM