• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

project

GCP Project Quotas

March 8, 2022

Here’s how to get your project quotas in GCP.

gcloud compute project-info describe --project your-project-id

gcloud compute project-info describe --project your-project-id

Filed Under: Cloud Tagged With: gcloud, gcp, project, quotas

GCP Regional Quotas

March 8, 2022

Here’s how to get Regional Quotas for your project in GCP.

gcloud compute regions describe us-central1 --project your-project-id

gcloud compute regions describe us-central1 --project your-project-id

Filed Under: Cloud Tagged With: gcloud, gcp, project, quotas, regional

GCP Display Roles on Service Account

October 6, 2021

How to display roles assigned to a GCP service account.

gcloud projects get-iam-policy your-project-id \
--flatten="bindings[].members" \
--format='table(bindings.role)' \
--filter="bindings.members:your-service-account@your-project.iam.gserviceaccount.com"

gcloud projects get-iam-policy your-project-id \ --flatten="bindings[].members" \ --format='table(bindings.role)' \ --filter="bindings.members:your-service-account@your-project.iam.gserviceaccount.com"

Result

ROLE
organizations/xxxxxxxxxxxxx/roles/role-name
roles/compute.instanceAdmin.v1
roles/compute.networkViewer
roles/logging.logWriter
roles/monitoring.metricWriter

ROLE organizations/xxxxxxxxxxxxx/roles/role-name roles/compute.instanceAdmin.v1 roles/compute.networkViewer roles/logging.logWriter roles/monitoring.metricWriter

Filed Under: Cloud Tagged With: display, gcp, project, roles, service account

GCP Listing Reservations

September 21, 2020

Here’s how to list reservations in GCP.

gcloud compute reservations list --project project-id

gcloud compute reservations list --project project-id

Specify a zone.

gcloud compute reservations list \
--filter="zone:('us-central1-a')" \
--project project-id

gcloud compute reservations list \ --filter="zone:('us-central1-a')" \ --project project-id

Filed Under: Cloud Tagged With: filter, gcp, list, project, reservations, zone

GCP Move Instance to Another Project

December 11, 2019

Here’s how to copy a disk from one project to another.

gcloud compute disks create lamp-server \
--source-snapshot https://www.googleapis.com/compute/v1/projects/project-id/global/snapshots/lamp-server \
--project next-project-id \
--zone us-central1-a

gcloud compute disks create lamp-server \ --source-snapshot https://www.googleapis.com/compute/v1/projects/project-id/global/snapshots/lamp-server \ --project next-project-id \ --zone us-central1-a

Once all the disks are copied. You can create a snapshot of the boot.

gcloud compute disks snapshot lamp-server

gcloud compute disks snapshot lamp-server

Create an instance from snapshot.

gcloud compute disks create "hostname-boot" \
--project "project-id" \
--zone "us-central1-a" \
--source-snapshot "snapshot-name" \
--type "pd-standard" \
--size "100"

gcloud compute disks create "hostname-boot" \ --project "project-id" \ --zone "us-central1-a" \ --source-snapshot "snapshot-name" \ --type "pd-standard" \ --size "100"

Filed Under: Cloud Tagged With: create, disks, gcp, instance, move, project, snapshots

GCP Lists Disk Per Project

August 9, 2019

Here’s the Google Cloud Platform (GCP) GCloud command to list all disks in a specific project.

gcloud compute disks list --project yourprojectname

gcloud compute disks list --project yourprojectname

Filed Under: Cloud Tagged With: disks, gcloud, gcp, google, list, project

  • Home
  • About
  • Archives

Copyright © 2023