Google Cloud コンソールを使用してワークフローを作成する
このクイックスタートでは、 Google Cloud コンソールを使用して最初のワークフローを作成、デプロイ、実行する方法について説明します。サンプル ワークフローは、リクエストを公開 API に送信してから、API のレスポンスを返します。
このタスクを Google Cloud コンソールで直接行う際の順を追ったガイダンスについては、「ガイドを表示」をクリックしてください。
始める前に
組織で定義されているセキュリティの制約により、次の手順を完了できない場合があります。トラブルシューティング情報については、制約のある Google Cloud 環境でアプリケーションを開発するをご覧ください。
- Google Cloud アカウントにログインします。 Google Cloudを初めて使用する場合は、 アカウントを作成して、実際のシナリオでの Google プロダクトのパフォーマンスを評価してください。新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Workflows API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Workflows API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.- 認証を設定します。
-
<0x
-
サービス アカウントの作成 IAM ロール(
roles/iam.serviceAccountCreator)とプロジェクト IAM 管理者ロール(roles/resourcemanager.projectIamAdmin)があることを確認します。ロールを付与する方法について学習する。 -
Google Cloud コンソールで、[サービス アカウントの作成] ページに移動します。
[サービス アカウントの作成] に移動 - プロジェクトを選択します。
-
[サービス アカウント名] フィールドに名前を入力します。 Google Cloud コンソールでは、この名前に基づいて [サービス アカウント ID] フィールドの値が設定されます。
[サービス アカウントの説明] フィールドに説明を入力します。例:
Service account for quickstart - [作成して続行] をクリックします。
-
サービス アカウントに [Logging] > [ログ書き込み] のロールを付与します。
ロールを付与するには、[ロールを選択] リストで [ロギング > ログ書き込み] を選択します。
- [続行] をクリックします。
-
[完了] をクリックして、サービス アカウントの作成を完了します。
-
サービス アカウントの作成 IAM ロール(
サービス アカウントのロールと権限の詳細については、ワークフローに Google Cloud リソースへのアクセス権限を付与するをご覧ください。
必要なロール
このクイックスタートを完了するために必要な権限を取得するには、プロジェクトに対する次の IAM ロールを付与するよう管理者に依頼してください。
-
サービス アカウント ユーザー(
roles/iam.serviceAccountUser) -
ワークフロー管理者 (
roles/workflows.admin)
ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。
ワークフローを作成してデプロイする
Google Cloud コンソールで、[ワークフロー] ページに移動します。
[ワークフロー] ページで、 [作成] をクリックします。
新しいワークフローの名前を入力します(例:
myFirstWorkflow)。リージョンには us-central1 を選択します。
[サービス アカウント] で、先ほど作成したサービス アカウントを選択します。
[次へ] を選択します。
次のワークフローをコピーしてワークフロー エディタに貼り付けます。
YAML
JSON
独自の検索キーワードを入力する場合を除き、このワークフローによりGoogle Cloud ロケーションを使用して検索キーワードが作成され、これが Wikipedia API に渡されます。関連する Wikipedia 記事のリストが返されます。
[デプロイ] を選択します。
ワークフローを実行する
ワークフローが正常にデプロイされると、最初のワークフロー実行を行えるようになります。ワークフローをデプロイすると、[ワークフローの詳細] ページが表示されます。
[ワークフローの詳細] ページで [ 実行] を選択します。
[ワークフローの実行] ページで、[実行] をクリックします。
[出力] ペインに、ワークフローの結果が表示されます。
これで最初のワークフローのデプロイと実行が完了しました。
クリーンアップ
このページで使用したリソースについて、 Google Cloud アカウントに課金されないようにするには、次の手順を実施します。
Google Cloud コンソールで、[ワークフロー] ページに移動します。
ワークフローのリストからワークフローをクリックして、[ワークフローの詳細] ページに移動します。
[削除] をクリックします。
ワークフローの名前を入力し、[確認] をクリックします。