Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use Google Cloud SDK on macOS

Google Cloud SDK is a set of tools that you can use to manage resources and applications hosted on Google Cloud Platform (GCP). It includes the gcloud command-line tool, which provides the primary CLI to interact with GCP services. The SDK is crucial for developers and system administrators who need to manage their cloud infrastructure efficiently.

Although Google Cloud SDK is not an Apple-specific tool, it is fully compatible with macOS. This article will guide you through the installation process and basic usage of Google Cloud SDK on a macOS environment.

Examples:

  1. Installing Google Cloud SDK on macOS

    To install the Google Cloud SDK on macOS, follow these steps:

    • Step 1: Download the SDK

      curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-<VERSION>-darwin-x86_64.tar.gz
    • Step 2: Extract the archive

      tar -xvf google-cloud-sdk-<VERSION>-darwin-x86_64.tar.gz
    • Step 3: Run the installation script

      ./google-cloud-sdk/install.sh
    • Step 4: Initialize the SDK

      ./google-cloud-sdk/bin/gcloud init
  2. Authenticating with Google Cloud

    After installation, you need to authenticate your SDK with your Google account:

    gcloud auth login
  3. Setting a Default Project

    Set a default project to avoid specifying the project ID in every command:

    gcloud config set project <YOUR_PROJECT_ID>
  4. Listing Available Services

    To list all available services in your project, use:

    gcloud services list
  5. Deploying an Application

    If you want to deploy an application to Google App Engine, navigate to your application directory and run:

    gcloud app deploy
  6. Managing Compute Engine Instances

    To list all Compute Engine instances:

    gcloud compute instances list

    To start an instance:

    gcloud compute instances start <INSTANCE_NAME>

    To stop an instance:

    gcloud compute instances stop <INSTANCE_NAME>

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.