google-cloud-platformgoogle-cloud-vertex-aikubeflow-pipelines

How do I give Vertex AI pipeline component permissions?


In a Vertex AI pipeline component,I try:

def my_comp(project_id: str, location: str, endpoint_id: str, endpoint: Output[Artifact]):
    import google.cloud.aiplatform as aip
    endpoints = aip.Endpoint.list()
...

which gives:

'aiplatform.endpoints.list' denied on resource '//aiplatform.googleapis.com/projects/...

My service account has owner permissions, and it works outside of the component. What do I need to do?


Solution

  • This permission denied on resource issue can be resolved by using import statement:

    from google.cloud import aiplatform_v1 as aiplatform