Generate Key.json For User Gcloud Cli

  1. Gcloud Cli Install
  2. Generate Key.json For User Gcloud Clip
  3. Install Gcloud Sdk


Gcloud compute disks snapshot kafka-data1-1 -async -snapshot-names=kafka-data-1 -project projecta -zone us-west1-a Use gcloud compute operations describe URI command to check the status of the operation(s). Regional disk gcloud beta compute instance attach-disk micro1 -disk pd-west1 -disk-scope regional debugging. Vault is now set up to generate credentials. Up until this point, you have acted as the Vault root sysadmin, setting up Vault for future users. We will now switch roles and act as a regular user of Vault. Generate a service account key using the secrets engine.

Other cheatsheets

multiple gcloud config


kubectl uses OAuth token generated by

  • gcloud config config-helper --format json
  • gcloud config config-helper --format='value(credential.access_token)'
  • gcloud auth print-access-token generates new token

Gcloud Cli Install



To return a list of zones given a region



switch gcloud context with gcloud config

service account and IAM

List IAM policy on the project level

service account level

GCS bucket level

Generate Key.json For User Gcloud Cli

app engine

cloud build

Cloud build trigger GCE rolling replace/start


gcloud command for creating an instance?

from web console

instances, template, target-pool and instance group

MIG with startup and shutdown scripts


tag the instances with no-ips

firewall rules

layer 3 network lb

layer 7 http lb



compute engine image

list an instance

move instance

gcloud compute instances move <instance_wanna_move> --destination-zone=us-central1-a --zone=us-central1-c

ssh & scp

ssh port forwarding for elasticsearch

The 2nd localhost is relative to elasticsearch-1`

ssh reverse port forwarding

for example, how to connect to home server's flask server (tcp port 5000) for a demo or a local game server in development

generate ssh config

serial port debug

disk snapshot

regional disk


instance level metadata

project level metadata

GCP managed ssl certificate

StackDriver logging

Enable Service

Client libraries you can use to connect to Google APIs

chaining gcloud commands

one liner to purge GCR images given a date


Machine Learning

[ aws . ec2 ]


Generate Key.json For User Gcloud Clip

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per Region.

The key pair returned to you is available only in the Region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any Region using ImportKeyPair .

For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.



--key-name (string)

A unique name for the key pair.

Constraints: Up to 255 ASCII characters

--dry-run--no-dry-run (boolean)

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

--cli-input-json (string)Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string)Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


Install Gcloud Sdk

To create a key pair

This example creates a key pair named MyKeyPair.


The output is an ASCII version of the private key and key fingerprint. You need to save the key to a file.

For more information, see Using Key Pairs in the AWS Command Line Interface User Guide.


KeyFingerprint -> (string)

KeyMaterial -> (string)

An unencrypted PEM encoded RSA private key.

KeyName -> (string)

KeyPairId -> (string)

The ID of the key pair.