メインコンテンツに移動
How to be a developer

生成 AI によるアプリケーション生成を体感 ! AWS App Studio のはじめ方

2025-02-03 | Author : 酒井 賢

はじめに

こんにちは。ソリューションアーキテクトの酒井です。

皆様は日々の業務において生成 AI をお使いでしょうか ?
生成 AI はテキストや画像、プログラムコードの生成などの様々な用途で業務を効率化します。もちろん私もその恩恵を受けている一人です。

本記事では生成 AI の新たな利用価値として、AWS App Studio を用いたアプリケーションの生成をご紹介します。生成 AI を活用することで、高度なソフトウェア開発スキルを持たない方でも、組織のニーズに合わせたビジネスアプリケーションを迅速に開発できます。本記事を通じて AWS App Studio の特徴を掴んでいただき、生成 AI を用いたアプリケーション開発を体感いただければ幸いです。


X ポスト » | Facebook シェア » | はてブ »

builders.flash メールメンバー登録

毎月提供されるクラウドレシピのアップデート情報とともに、クレジットコードを受け取ることができます。 
今すぐ特典を受け取る »

AWS App Studio とは

AWS App Studio は自然言語を使用してエンタープライズグレードのアプリケーションを構築する、生成 AI を用いたサービスです。在庫管理、多段階承認プロセス、クレーム管理、検査と監査、レポートなど、幅広い業務に向けた Web アプリケーションの作成に役立ちます。まずは AWS App Studio の仕組みを理解する上で重要な用語とそれらの関係性をご紹介いたします。

こちらの図は AWS App Studio で開発するアプリケーションの構成要素を示す図です。AWS App Studio application が示すアプリケーションは次の 3 つの要素を含みます。

Architecture diagram illustrating the components of AWS App Studio, including user interface (UI), logic (automation), data (entities), and connectors to external AWS and third-party services.

Page

  • データ入力フォームや一覧など、ユーザーが操作するアプリケーションの画面です。データを入力するためのテキストボックスやデータ登録を指示するためのボタンなど、画面の構成要素に当たる Component を配置します。
  • 画面間でのデータ授受や画面上で入力された値を後述する Automation に渡す場合、 Parameter を利用します。
  • Screenshot of the AWS App Studio campaign management dashboard displaying a campaign table, navigation menu, and components available for building AI-driven applications.

    Automation

    • アプリケーションのビジネスロジックを定義します。 E メールの送信、データレコードの作成、Lambda 関数の呼び出し、API の呼び出しなど、特定の処理を実行する単一もしくは複数の Action で構成されます。
    • Trigger は Automation をいつ、どのような条件で実行するかを決定します。 Trigger は 画面上のボタンなどの Component に割り当てられ、ボタンをクリックした際などに Automation を実行します。
    Screenshot of AWS App Studio showing an example campaign automation workflow with parameters and step creation for managing campaigns.

    Entity

    • Amazon Aurora や Amazon DynamoDB などのデータソースとアプリケーションの仲介をするデータモデルです。データの項目や型を定義する Field、データを検索して返す Query、Connector を介して接続するデータソースの列と Field を対応づける Mapping が含まれます。
    • アプリケーション開発時に利用するサンプルデータを保持します。Field 定義に応じたサンプルデータを自動で生成可能です。
    Screenshot of AWS App Studio showing an example campaign automation workflow with parameters and step creation for managing campaigns.

    Connector

    また AWS App Studio で開発するアプリケーションは Connector を介して Amazon Aurora や Amazon DynamoDB など他の AWS サービス、またはサードパーティのサービスに接続します。Connector はデータストアへの接続だけでなく、API の呼び出しにも利用します。
    Overview diagram displaying AWS connectors (Amazon Aurora, Amazon DynamoDB, Amazon Redshift, Amazon S3, Other AWS services) and external connections (API Connector, OpenAPI Connector, Salesforce) with short descriptions of their integration capabilities.

    備考

    2024 年 12 月の本記事執筆時点では AWS App Studio は米国西部 (オレゴン) リージョンとヨーロッパ (アイルランド) リージョンで利用可能です。また AWS App Studio は他のリージョンのデータに接続するためのクロスリージョン呼び出しをサポートしています。クロスリージョン呼び出しにより、米国西部 (オレゴン) リージョンで稼働する AWS App Studio アプリケーションから、アジアパフィシック (東京) リージョンに配置された Amazon Aurora や Amazon DynamoDB などのデータソースへ接続可能です。

    AWS App Studio の利用者

    AWS App Studio の利用者は次の 3 種に分別されます。

    • Admin
      AWS App Studio のユーザーとグループの管理、 Connector の管理、Builder が作成したアプリケーションの管理を行うことができます。 さらに Admin は Builder が持つすべての権限が付与されます。

    • Builder
      アプリケーションを作成および公開できます。 Builder はアプリケーションで利用する Connector を選択できますが、Connector 自体を作成および変更することはできません。

    • App User
      Builder が作成したアプリケーションの利用者です。自身に対して公開されたアプリケーションを利用できます。

    AWS App Studio でのアプリケーション開発の流れ

    AWS App Studio はシステム開発工程に応じた、開発用のプレビュー環境、テスト環境、本番環境とのアプリケーション実行環境を提供します。また次の図はそれらの環境を用いた AWS App Studio でのアプリケーション開発ライフサイクルを簡略化したものです。

    • Build app
      Page、Automation、Entity を組み合わせてアプリケーションを作成します。

    • Preview

      • プレビュー環境でアプリケーションを実行し、Builder 自身が画面表示や機能をテストします。プレビュー環境ではアプリケーションを公開せずにすばやくテストと修正を繰り返すことができます。

      • プレビュー環境のアプリケーションは外部サービスと接続しません。Entity が保持するサンプルデータやモックで定義する擬似的な API 応答を利用します。

    • Testing

      • テスト環境にアプリケーションを公開し、アプリケーションの外部サービスとの接続や相互作用をテストします。また一部の App User にアプリケーションを公開し、エンドユーザーテストを行います。

      • アプリケーションを公開するたびに新しいバージョンが発生します。

    • Production
      本番環境にアプリケーションを公開し、新しいアプリケーションの最終テストを行います。

    • Share application
      新しいアプリケーションを本番環境へ公開後、エンドユーザーである App User に共有します。

    A diagram illustrating the app development workflow, showing the stages: Build app, Preview, Testing, Production, and Share application, with arrows indicating the process flow and feedback loops.

    Publish Center

    こちらの図は作成したアプリケーションをテスト環境および本番環境へ公開する Publish Center です。テスト環境と本番環境それぞれにアプリケーションの URL が提供されていることがわかります。
    Diagram showing the AWS App Studio publish flow, illustrating the progression of an app through Development, Testing, and Production environments with descriptions of each stage and successful publishing indicators.

    次の準備作業

    またアプリケーションの開発に着手する前に Admin が実施すべき次の準備作業があります。

    • AWS App Studio インスタンスの作成

    • AWS IAM Identity Center グループを使用したユーザーアクセスの設定

    • Connector の作成


    では早速準備作業を実施し、開発ライフサイクルに沿ってアプリケーションの作成を進めていきましょう !

    AWS App Studio でのアプリケーション開発準備

    AWS App Studio インスタンスの作成

    AWS App Studio の利用を開始するため、インスタンスを作成します。 AWS Organizations の管理下にない AWS アカウントにログインします。AWS マネジメントコンソールで App Studio と検索し、ランディングページで「開始」を押下します。

    なお、AWS App Studio のインスタンスはすべての AWS リージョンで 1 つのみ作成可能です。 既に AWS App Studio のインスタンスがいずれかのリージョンに存在する場合、別のリージョンでインスタンスを作成する前に既存インスタンスを削除する必要があります。

    Screenshot of the AWS App Studio Japanese landing page, featuring information about building enterprise-grade applications using natural language and generative AI services. The page includes setup instructions and an overview of App Studio, displayed in Japanese.

    3 つの利用形態

    AWS App Studio は利用者の認証に AWS IAM Identity Center を利用し、次の 3 つの利用形態があります。

    • 既存の AWS IAM Identity Center 組織インスタンス を利用する

    • 既存の AWS IAM Identity Center アカウントインスタンスを利用する

    • 新規の AWS IAM Identity Center アカウントインスタンスを利用する


    本記事では利用手順の簡略化のため ”新規の AWS IAM Identity Center アカウントインスタンスを利用する” をご紹介します。残る 2 つの手順については AWS App Studio User Guide の Create an App Studio instance in the AWS Management Console をご確認ください。

    備考
    前提条件によりますが、基本的には “既存の AWS IAM Identity Center 組織インスタンス を利用する” を推奨します。アカウントインスタンスは組織インスタンスのサブセットに位置付けられ、機能制約があります。アカウントインスタンスの詳細については IAM アイデンティティセンターのアカウントインスタンス をご確認ください。AWS App Studio の利用に関する機能制約としては、アカウントインスタンスが AWS アカウントへのアクセスをサポートしていない点があります。本制約によりアカウントインスタンスで認証する Admin は AWS App Studio が接続するデータソースや API などの AWS サービスを管理できず、Connector 作成に際して AWS サービスの管理者との連携が必要となります。AWS App Studio の管理および AWS App Studio から接続する AWS サービスの管理に必要な権限を集中的に管理する上では、“既存の AWS IAM Identity Center 組織インスタンス を利用する” が有効です。

    アカウントインスタンスを作成

    ”新規の AWS IAM Identity Center アカウントインスタンスを利用する” 場合、「 自分用のアカウントインスタンスを作成」を選択します。
    AWS App Studioのインスタンス作成手順を説明する日本語インターフェースのスクリーンショット。アカウントの許可やシングルサインオン、IAMアイデンティティセンターアカウントの選択に関する案内が表示されている。

    備考

    この画面が表示された場合、AWS アカウントが AWS Organizations の管理下におかれ、AWS IAM Identity Center 組織インスタンスが既に存在している可能性があります。AWS App Studio インスタンスの作成に際しては、上記“既存の AWS IAM Identity Center 組織インスタンス を利用する”手順の実施、もしくは AWS Organizations の管理下にない AWS アカウントをご用意ください。

    Screenshot of the AWS App Studio instance creation screen in Japanese, showing options for selecting administrator and builder groups for single sign-on configuration.

    ユーザー情報入力

    次に AWS App Studio の Admin および Builder のユーザー情報を入力します。入力後は確認事項をチェックした上で「設定」ボタンを押下します。

    本記事の執筆にあたり私が生成した AWS App Studio インスタンスは 30 分程度で作成が完了しました。

    Screenshot of the AWS App Studio user and group creation interface in Japanese, showing input fields for group and user details, including email addresses and user names, as well as buttons for adding users to the App Studio platform.

    招待メール送信

    Admin および Builder として入力したユーザーのメールアドレスに対し、AWS IAM Identity Center から招待メールが届きます。

    Accept invitation」を押下し、表示された画面でパスワードを設定の上でサインアップを行います。

    Screenshot of an AWS IAM Identity Center invitation email. The email includes a message inviting the user to activate their account, an 'Accept invitation' button, instructions about the AWS access portal, and the user's username. AWS branding is visible at the top.

    App User 登録

    また、アプリケーションの利用者に当たる App User の登録をします。

    ”新規の AWS IAM Identity Center アカウントインスタンスを利用する”場合、AWS App Studio のインスタンス作成と並行して AWS IAM Identity Center インスタンスも作成されます。AWS マネジメントコンソールで IAM Identity Center と検索し、IAM Identity Center の画面で AWS App Studio アプリケーションを利用するユーザーとユーザーが所属するグループを作成します。図は App Studio ユーザーというグループに taro sakai というユーザーが所属している状態です。

    AWS IAM Identity Center でのユーザーとグループの作成方法は IAM Identity Center で ID を管理する をご確認ください。

    Screenshot of AWS IAM Identity Center's App Studio user group management screen with Japanese language interface, showing navigation, user search, and user details within a group.

    AWS App Studio インスタンス作成完了

    AWS App Studio インスタンスの作成が完了するとインスタンスへアクセスするための URL が提供されます。

    URL にアクセスし、AWS App Studio の利用を開始します。

    Screenshot of the AWS App Studio overview page in Japanese, describing how users can quickly build enterprise-grade applications using natural language and generative AI. The interface provides details about application management and setup, with instructions and descriptions displayed in Japanese.

    利用ユーザーグループの紐付け

    次に AWS IAM Identity Center で作成した AWS App Studio アプリケーションを利用するユーザーが所属するグループを AWS App Studio で App User として利用するための紐付けを行います。

    この画面が表示されましたら、左側のメニューから「Roles」を押下します。

    Screenshot of the AWS App Studio Admin Hub dashboard, showing options to manage users, roles, and app connectors, with a navigation menu on the left.

    グループを追加

    画面右上の「+ Add group」を押下し、以下の通り入力の上で「Add」を押下します。

    • Group identifier で AWS IAM Identity Center にて作成した AWS App Studio アプリケーション利用者用グループを選択

    • Role で「App User」を選択


    これにて準備作業の AWS App Studio インスタンスの作成と AWS IAM Identity Center グループを使用したユーザーアクセスの設定は完了です。

    続いてアプリケーションの作成に進みます !

    Screenshot of the AWS App Studio interface showing the 'Add group' dialog in the Roles section, where users can specify an AWS IAM Identity Center group and assign a role such as Builder, Admin, or App User.

    AWS App Studio でのアプリケーション開発

    生成 AI によるアプリケーションの作成

    • AWS App Studio 画面左側のメニューから「Builder hub」を選択します

    • 表示された画面右上の「+ Create app」を押下します

    • App name を入力し、「Generate an app with AI」を選択の上、「Next」を押下します

    Screenshot of AWS App Studio displaying the 'Create app' dialog, highlighting the option to generate an app with AI or start from scratch.

    Connector の選択

    次はアプリケーションがデータソースなどへ接続する際に利用する Connector の選択です。アプリケーションがデータソースとして Amazon Aurora や自己管理をする Amazon DynamoDB などへ接続をする場合、 Connector を事前に作成する必要があります。一方 Connector を作成せず、AWS App Studio が管理する Connector を利用することも可能です。AWS App Studio が管理する Connector の特徴は次の通りです。

    • AWS App Studio と 同じAWS アカウントの同じリージョンに自動作成される Amazon DynamoDB テーブルをデータソースとして利用する

    • 作成された Amazon DynamoDB テーブルは IAM ポリシーに準じて AWS マネジメントコンソールや他の AWS サービスからアクセス可能

    • AWS App Studio で Entity に Field の追加などの変更を加えると、対応する Amazon DynamoDB テーブルに反映される

    本記事では AWS App Studio が管理する Connector を利用し、アプリケーション作成を進めます。画面右下の「Skip」を押下します。

    Screenshot of the AWS App Studio interface showing the optional step to connect existing data sources by selecting a connector, such as DynamoDB, to allow access to data sources. Users can choose to skip this step and add data sources later.

    備考

    Connector を作成してデータソースへ接続する場合、Entity を設定し接続されたデータソースの列と Field を対応づける Mapping が必要です。データモデルに変更を加える場合はデータソースと Entity の両方を更新し、変更した Field を再度 Mapping する必要があります。この方法は柔軟性があり、さまざまなタイプのデータソースを使用できますが、事前の計画と継続的なメンテナンスが必要になります。

    自然言語でアプリケーションを記述

    次の画面では自然言語でアプリケーションを記述し、生成 AI を用いたアプリケーション生成を行います。アプリケーションの記述は自由入力だけでなく、IT 資産管理や承認フローなどのよくある業務に対するサンプルも利用可能です。生成 AI によって作成されたアプリケーションを修正する形での開発は、一からアプリケーションを開発する方法に比べて開発期間の短縮や学習コストの削減につながります。

    画面左下のテキストボックスにアプリケーションの記述を入力し、矢印を押下します。

    Screenshot of the AWS App Studio interface for generating applications using AI, featuring a text box for describing the app and sample prompts such as IT Inventory Management and Project Approvals. The user can either type an app description or select from provided sample prompts.

    出力れた要件と機能仕様を確認

    アプリケーションの記述を入力すると、生成 AI はアプリケーションに求められる要件とおおまかな機能仕様を出力します。アプリケーションに求められる要件はユースケース、想定する利用者の操作、データモデルなどです。おおまかな機能仕様はアプリケーションの概要、主な機能、機能の使用方法などです。

    それらの内容を確認し、アプリケーションの要件に沿っている場合は画面右下の「Generate app」を押下し、アプリケーションを生成します。修正をする場合は再度アプリケーションの記述を入力します。

    Screenshot of the AWS App Studio interface showing the process of generating an application using AI. The screen displays requirements gathering, use case creation, and user flows for an IT hardware request management app, with options to modify app requirements and generate the app.

    アプリケーション生成完了

    こちらの図の通り無事にアプリケーションが生成されました。Page や Automation、Entity などの構成要素を色々と探索してください !
    Screenshot of the AWS App Studio interface showing a confirmation message 'Your app has been created!' and options to edit or preview the newly created app on the dashboard.

    備考

    本記事の執筆にあたり私が生成したアプリケーションは生成直後の段階で 2 つのエラーを抱えていました。エラー内容は画面下部のデバッグコンソールを展開することで確認できます。エラーは HardwareRequestUpdate1 および HardwareRequestForm1 との Automation で発生し、E メール送信用の action で用いる Amazon SES 用の Connector が設定されていないというものでした。Connector の追加、もしくは E メール送信用の action を削除することで対処可能です。デバッグコンソール右側の view を押下するとエラーが発生している画面を表示します。

    Screenshot of AWS App Studio displaying an automation workflow where the SendEmail action using Simple Email Service (SES) shows an error due to a missing connection selection. Error messages at the bottom indicate that the sendEmail action in the automation requires a connection to be selected.

    アプリケーションのプレビュー

    一通りアプリケーションの構成要素を確認してエラーへの対処をした後、アプリケーションを実際に操作してみましょう。アプリケーションを実行するため、画面右上の「Preview」を押下します。

    実際に操作可能なアプリケーションの画面が表示されました。一覧表での検索やデータ登録など、アプリケーションの動作を確認することができます。

    なお、プレビュー環境のアプリケーションは外部サービスと接続しません。Entity が保持するサンプルデータやモックで定義する擬似的な API 応答を利用します。

    Screenshot of an AWS App Studio IT Asset Management dashboard showing total, pending, and approved requests, as well as an open requests table including hardware requests and statuses.

    テスト環境への公開および外部サービスと連携したテスト

    プレビュー環境での確認が完了した後、テスト環境にアプリケーションを公開し、外部サービスと連携した最終的なテストを行います。

    テスト環境へアプリケーションを公開するには、画面右上の「Publish」を押下します。表示された画面で該当バージョンの説明を入力し、画面右下の「Start」を押下します。

    Screenshot of the 'Publish your updates' dialog in AWS App Studio, showing the process of publishing an app from the development environment to testing, with instructions and warnings about incompatible updates.

    通知メールを受信

    テスト環境へのアプリケーションの公開が成功した場合、図のような通知メールが送信されます。

    View app」を押下してテスト環境のアプリケーションに接続可能です。

    A notification from AWS App Studio indicating that an app is live in the Testing environment, showing a successful publishing message and a 'View app' button.

    テスト環境にアクセス

    テスト環境にアクセスするための URL は Publish Center でも確認できます。

    Publish Center の表示は画面右上の Publish 右側の▼を押下します。

    Screenshot of AWS App Studio interface showing the workflow for publishing an app through three environments: Development, Testing, and Production. The image illustrates how each environment is used, including development sandbox, user acceptance testing, and live production promotion.

    テスト環境公開したアプリケーションの連携

    テスト環境に公開したアプリケーションは外部サービスと連携します。以下の ITAssetManagement アプリケーションは AWS App Studio が管理する Connector を介し、Amazon DynamoDB テーブルをデータソースとして利用しています。
    Screenshot of an IT asset management dashboard interface showing request management options, statistics for total, pending, and approved requests, and an open requests table with asset request details.

    備考

    本記事の執筆にあたり私が生成したアプリケーションは Employees、HardwareRequest、Asset の 3 つの Entity を作成し、対になる 3 つの Amazon DynamoDB テーブルも作成しました。


    こちらは AWS マネジメントコンソールで HardwareRequest Entity のデータを格納する Amazon DynamoDB テーブルをスキャンした結果です。テスト環境のアプリケーションから登録したデータが格納されていることがわかります。

    本番環境への公開とエンドユーザーへの共有

    テスト環境でのテストが完了した後、本番環境にアプリケーションを公開し、エンドユーザーに提供をします。本番環境へのアプリケーションの公開は Publish Center で実施します。

    Publish Center の表示は画面右上の Publish 右側の▼を押下します。Publish Center ではテスト環境を示す Testing と本番環境を示す Production の間の「Publish」を押下します。

    Screenshot of AWS App Studio interface showing the workflow for publishing an app through three environments: Development, Testing, and Production. The image illustrates how each environment is used, including development sandbox, user acceptance testing, and live production promotion.

    通知メールから本番環境アプリケーションに接続

    本番環境へのアプリケーションの公開が成功した場合、このような通知メールが送信されます。 「 View app」を押下して本番環境のアプリケーションに接続可能です。本番環境にアクセスするための URL は Publish Center でも確認できます。
    Screenshot of an AWS App Studio notification stating 'Your app is live,' congratulating the successful publishing of an app named 'Untitled 20241204_0516' and displaying a 'View app' button.

    公開アプリケーションをエンドユーザーに共有

    最後に本番環境へ公開したアプリケーションをエンドユーザーに共有するため、以下の操作を実施します。

    • 画面上部の「Share」を押下します

    • Production」タブを選択します

    • GROUPS で App User が所属するグループを選択します

    • Share」 ボタンを押下します

    備考
    Testing タブまたは Production タブが表示されない場合、アプリケーションが対応する環境に公開されていない可能性があります。


    以上で生成 AI を用いたアプリケーションの生成およびテスト、またエンドユーザーへの公開に至る一連の操作は完了です。お疲れ様でした !

    Screenshot of the 'Share' dialog in AWS App Studio showing the process for providing production access to groups for an application environment, with group selection options in Japanese and English.

    まとめ

    本記事では、AWS App Studio による生成 AI を用いたアプリケーション作成からエンドユーザーへの提供に至る、開発ライフサイクルをご紹介しました。

    AWS App Studio は自然言語を使用してエンタープライズグレードのアプリケーションを構築する、生成 AI を用いたサービスです。在庫管理、多段階承認プロセス、クレーム管理、検査と監査、レポートなど、幅広い業務に向けた Web アプリケーションを迅速に開発し、エンドユーザーへ提供することが可能です。

    またシステム開発工程に応じた、開発用のプレビュー環境、テスト環境、本番環境とのアプリケーション実行環境および、開発ライフサイクルを進めるための機能を提供します。これらは従来のシステム開発プロセスを効率化するだけでなく、高度なソフトウェア開発スキルを持たない方へアプリケーション開発の門戸を開くとともに、開発工数に対する費用対効果の制約から人間系での対応をせざるを得なかった業務をシステム化する道筋にもつながります。

    2024 年 12 月の本記事執筆時点では AWS App Studio は米国西部 (オレゴン) リージョンとヨーロッパ (アイルランド) リージョンで利用可能です。またアジアパフィシック (東京) リージョンに配置された Amazon Aurora や Amazon DynamoDB などのデータソースへ接続するクロスリージョン呼び出しが可能です。

    新たなアプリケーションの開発とともに、既存アプリケーションのリプレイスやクライアントサーバーシステムの Web アプリケーション化などもご検討ください。

    筆者プロフィール

    酒井 賢
    アマゾン ウェブ サービス ジャパン合同会社
    シニア ソリューションアーキテクト

    SIer にて自社プロダクト開発、運用現場、プロジェクトマネジメント、クラウドサービス導入など経験。ビジネス現場でのクラウド活用を加速するべく現職に。
    オートバイ、キャンプ、釣りが趣味。テントを積んだバイクで日本全国のキャンプ場を駆け回っている。
    Portrait of a man wearing glasses and a black shirt, smiling at the camera, on a light background.