Projekt erstellen

Zur Bereitstellung Ihrer Anwendung in App Engine müssen Sie ein Google Cloud Projekt erstellen. Das Projekt ist ein Container auf oberster Ebene, der Ihre App Engine-Anwendungsressourcen sowie andere Google Cloud -Ressourcen enthält.

In dieser Aufgabe erstellen Sie ein Google Cloud -Projekt und eine App Engine-Anwendung, um darin Einstellungen, Rechenressourcen, Anmeldeinformationen und Metadaten für Ihre Anwendung zu speichern.

Wenn Sie bereits ein Google Cloud -Projekt mit App Engine und der Cloud Build API haben, fahren Sie mit Webdienst schreiben fort.

ein Projekt in Google Cloud erstellen

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. Enable the Cloud Build API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  4. Install the Google Cloud CLI.

  5. Configure the gcloud CLI to use your federated identity.

    For more information, see Sign in to the gcloud CLI with your federated identity.

  6. To initialize the gcloud CLI, run the following command:

    gcloud init
  7. Erstellen Sie in der Google Cloud Console eine App Engine-Anwendung für Ihr Google Cloud -Projekt.

    App-Erstellung öffnen

  8. Wählen Sie eine Region aus, in der sich die Rechenressourcen Ihrer App befinden sollen.

  9. Aufgrund von Änderungen am Standardverhalten für die Verwendung von Dienstkonten durch Cloud Build in neuen Projekten und Änderungen an Organisationsrichtlinien, die standardmäßig für Sicherheit sorgen, müssen Sie Ihrem Bereitstellungsdienstkonto möglicherweise zusätzliche Rollen zuweisen. Weitere Informationen zum Zuweisen bestimmter Rollen finden Sie in der Anleitung zur Fehlerbehebung.

Nächste Schritte

Ihr Google Cloud -Projekt ist nun eingerichtet und Sie können einen einfachen Webdienst mit Java schreiben.