App Engine にアプリをデプロイするには、 Google Cloud プロジェクトを作成する必要があります。これは、App Engine アプリケーション リソースと他の Google Cloud リソースを保持する最上位コンテナです。
このタスクでは、アプリの設定、コンピューティング リソース、認証情報、メタデータを格納する Google Cloud プロジェクトと App Engine アプリケーションを作成します。
App Engine の Google Cloud プロジェクトがすでに存在し、Cloud Build API を有効にしている場合は、ウェブサービスの作成に進みます。
Google Cloud プロジェクトを作成する
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Cloud Build API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. -
Install the Google Cloud CLI.
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します。
gcloud init
-
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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Cloud Build API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. -
Install the Google Cloud CLI.
-
外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。
-
gcloud CLI を初期化するには、次のコマンドを実行します。
gcloud init
Google Cloud コンソールで、 Google Cloud プロジェクトの App Engine アプリケーションを作成します。
アプリのコンピューティングリソースを配置するリージョンを選択します。
- 新しいプロジェクトで Cloud Build がサービス アカウントを使用する方法のデフォルトの動作が変更され、「デフォルトで保護」の組織ポリシーが変更されたため、デプロイするサービス アカウントに追加のロールを付与することが必要になる場合があります。特定のロールを付与する方法については、トラブルシューティング ガイドをご覧ください。
次のステップ
以上で Google Cloud プロジェクトが設定されたため、Java を使用した基本的なウェブサービスの作成を開始できます。