magnificent-helicopter-3467
06/22/2022, 10:38 PMsa, err := serviceaccount.NewAccount(ctx, s.Name, &serviceaccount.AccountArgs{
AccountId: pulumi.String(s.Id),
DisplayName: pulumi.String("A service account for my app"),
})
if err != nil {
return err
}
fmt.Println("Service account email: ", sa.Email)
storageAdmin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
Bindings: []organizations.GetIAMPolicyBinding{
organizations.GetIAMPolicyBinding{
Role: "roles/compute.storageAdmin",
Members: []string{
sa.Email,
},
},
},
}, nil)
2 questions here:
• Can I rely on using sa.Email
after calling serviceaccount.NewAccount
? Or does that run asynchronously and populate sa
with promise-like values?
• If I can use sa.Email
where I have it, how do I convert this pulumi.StringOutput
to String
?