https://pulumi.com logo
#general
Title
# general
b

better-umbrella-26052

08/18/2023, 7:44 PM
Docs on gcp service account, https://www.pulumi.com/registry/packages/gcp/api-docs/serviceaccount/iambinding/#service-account-iam-binding gives an example for Service Account IAM Binding as
Copy code
sa = gcp.service_account.Account("sa",
    account_id="my-service-account",
    display_name="A service account that only Jane can use")
admin_account_iam = gcp.service_account.IAMBinding("admin-account-iam",
    service_account_id=sa.name,
    role="roles/iam.serviceAccountUser",
    members=["user:jane@example.com"])
But similar code gives this basic error:
Copy code
pulumi:pulumi:Stack (x-vpc-dev):
    error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "C:\infra\cloud\gcp\mdcm_vpc_twingate\__main__.py", line 200, in <module>
        iam_binding1 = service_account.IAMBinding(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'Account' object has no attribute 'IAMBinding'