您如何在两个单独的Google Cloud Platform(GCP)项目中授予对资源的访问权限?

时间:2019-02-27 18:13:34

标签: google-cloud-platform

假设您有两个项目,ID = # neighbors via Delaunay tesselation tri = Delaunay(centers) # draw centers and neighbors fig = plt.figure(figsize=(10,10)) ax = fig.add_subplot(111) plt.imshow(mark_boundaries(img, segments)) plt.scatter(centers[:,1],centers[:,0], c='y') # this contains the neighbors list: tri.vertex_neighbor_vertices indptr,indices = tri.vertex_neighbor_vertices # draw lines from each center to its neighbors for i in range(len(indptr)-1): N = indices[indptr[i]:indptr[i+1]] # list of neighbor superpixels centerA = np.repeat([centers[i]], len(N), axis=0) centerB = centers[N] for y0,x0,y1,x1 in np.hstack([centerA,centerB]): l = Line2D([x0,x1],[y0,y1], alpha=0.5) ax.add_line(l) engine-project-1

storage-project-1有一个基本的App Engine应用程序,需要访问engine-project-1中存储桶中的图像文件。默认情况下,拒绝storage-project-1访问engine-project-1

您如何授予storage-project-1中的app-engine-service角色(engine-project-1@appspot.gserviceaccount.com)访问engine-project-1帐户中的存储角色(roles/storage.objectViewer)?

1 个答案:

答案 0 :(得分:3)

用例-允许外部App Engine应用访问构建状态

在此示例中,在storage-project-1中运行的App Engine应用需要访问${SOURCE_PROJECT_ID}中的构建状态。

使用为项目ID = ${GOOGLE_CLOUD_PROJECT}激活的云外壳,可以轻松完成此操作

授予外部服务原则作用

${GOOGLE_CLOUD_PROJECT}

More details on the solution here