TOP>コラム一覧>Amazon Q (AWS builder use)について何ができるか調べてみた

Amazon Q (AWS builder use)について何ができるか調べてみた

はじめに

こんにちは、高橋です。
皆さんAmazon Q (AWS builder use)は使っていますか?
私は日々の業務の中で度々使っています。
Amazon Q (AWS builder use)はAWSコンソールに統合され、AWSに関するさまざまなことを答えてくれる生成AIアシスタントです。そのため、AWSに関する質問・疑問があったり、設定操作中に分からないことがあったりしたときに、気軽に質問して、即回答が得らえれるため、これまで調査に使っていた時間を大幅に減らすことができるサービスです。
ただそこで疑問に出てくるのがAmazon Q (AWS builder use)は何をどこまで答えてくれるかということで、今回はその調査を行ってみました。

1.Amazon Q (AWS builder use)の使い方

Amazon Q (AWS builder use)はAWSコンソールに統合されており、利用するにはAWSコンソールの右上の方にある六角形のマークをクリックするとアクセスすることができます。

開いた画面で下のテキストボックスにAWSに関する質問を英語で入力します。

すると回答をエビデンスと共に出力してくれます。

こんな感じで簡単に利用することができます。

2.Amazon Q (for builder Use)に対する質問事項

では、ここからはAmazon Q (for builder Use)が何をどこまで答えてくれるか調べてみたいと思います。AWSを利用する上で質問することは何かな?と考えてみると真っ先に思うのはコンソールでのAWSサービスの設定方法ですが、実際に使おうとする、或いは使っていると他にも見積をするための料金調査や、障害発生時のエラーメッセージの内容調査、障害や課題に対する対策、さらにはAWS利用に関する契約条項の確認等、非常に多種多様なものがあります。そこで今回は多様な以下の13項目について確認をしてみたいと思います。

ジャンル 質問内容 調査目的
1 操作方法 EC2で利用中のEBSボリュームを暗号化する方法は? 一般的な質問に回答可能か?
2 操作方法 AWS CLIでセキュリティグループに新しい許可を追加するコマンドを教えてください。 AWS CLIを用いた具体的な設定までアシスト可能か?
3 情報収集 東京リージョンで稼働しているEC2インスタンスを教えてください。 自分のアカウント内の情報を収集してくれるか?
4 情報収集 インスタンスID XXXのディスク容量を教えてください。 利用中のアカウント内のリソースに関する情報を調べることは可能か?
5 障害 東京リージョンで現在障害は発生していますか? AWS自体の障害が調査可能か?
6 障害 このアカウント内のリソースに障害は発生していますか? アカウント内の障害が調査可能か?
7 障害 以下のエラーメッセージの意味を教えてください。 エラーメッセージの意味と対処法を確認可能か?
8 料金 東京リージョンで稼働する Windows m5.large EC2インスタンスの時間単価を教えてください。 AWSリソースの時間単価を調査可能か?
9 料金 このアカウントの現在の利用料金を教えてください。 利用中のアカウントの利用料金は調査可能か?
10 リコメンド データベース識別子IDXXXのセキュリティを強化するためのアドバイスをください。 利用中のアカウントのリソースに対する推奨事項提示が可能か?
11 リコメンド このアカウントで購入するCompute Savings Plansの推奨値を教えてください。 利用中のアカウントのコスト最適化の推奨値の提示が可能か?
12 契約 現在契約しているサポートプランを教えてください。 AWSと契約いているサポートプランが確認できるか?
13 契約 このアカウントはどの国の法律に準拠していますか? 利用中のアカウントからCAがどの様に適用されているか確認できるか?

3.Amazon Q (for builder Use)による回答

実際の回答の画面を張るとページが長くなりすぎるため、ここでは実際の回答をボックスの中に記載します。なお、記載する回答は具体的なメッセージのみで同時に表示されるソースは省力しています。

1. EC2で利用中のEBSボリュームを暗号化する方法は?

There are a few ways to encrypt EBS volumes that are currently in use on EC2 instances:

  1. 1.Create an encrypted EBS snapshot of the unencrypted volume. Then create a new encrypted volume from that snapshot and attach it to the instance. Applications would need to be migrated to the new volume.
  2. 2.Use the AWS CLI to encrypt the volume in-place while it remains attached. For example:
    aws ec2 modify-volume --volume-id vol-1234567890abcdef0 --encrypted
  3. 3.Create an AWS Systems Manager document that uses the
    ec2:ModifyVolume
    action to encrypt volumes on a schedule. This allows automation of in-place encryption for all volumes.
  4. 4.Leverage AWS Config rules and remediation to detect unencrypted volumes and automatically encrypt them using the above approaches. This ensures all current and new volumes remain encrypted.

The best option depends on factors like application downtime tolerance and need for automation/audit. AWS Documentation provides more details on specific encryption steps and best practices.

→ 1は王道のやり方で、ちゃんと回答が得られました。

2.AWS CLIでセキュリティグループに新しい許可を追加するコマンドを教えてください。

The command to add new permissions to a security group using the AWS CLI is:

aws ec2 modify-security-group-rules

The modify-security-group-rules command allows you to modify the ingress and egress rules of a security group. You need to specify the --group-id parameter to identify the security group and --security-group-rules parameter to define the new rules.

For example:
aws ec2 modify-security-group-rules --group-id sg-1234567890abcdef0 --security-group-rules IpPermissions=[{IpProtocol: "tcp", FromPort: 80, ToPort: 80, IpRanges: [{CidrIp: "0.0.0.0/0"}]}]

This adds a new rule to allow TCP traffic on port 80 from 0.0.0.0/0 (anyone) to the security group identified by the ID.

You can refer to the AWS documentation for details on the parameters and format of the security group rules specification.

→ こちらも問題なく回答が得られました。

3. 東京リージョンで稼働しているEC2インスタンスを教えてください。

It looks like you need help with network connectivity issues. Amazon Q works with VPC Reachability Analyzer to provide an interactive generative AI experience for troubleshooting network connectivity issues. You can try the preview experience here (available in US East N. Virginia Region).

→ アカウント内のリソースの情報収集は行ってくれませんでした。

4. インスタンスID XXXのディスク容量を教えてください。

It looks like you need help with network connectivity issues. Amazon Q works with VPC Reachability Analyzer to provide an interactive generative AI experience for troubleshooting network connectivity issues. You can try the preview experience here (available in US East N. Virginia Region).

→ 3が無理でしたので、こちらもやはり無理でした。

5. 東京リージョンで現在障害は発生していますか?

Based on the information provided, there do not appear to be any known widespread issues occurring currently in the Tokyo region. Some key points:

  1. 1.The search results discussed the Osaka region and availability zones within each region, but did not mention any specific problems in Tokyo.
  2. 2.Transient issues could occasionally affect individual availability zones or instances, but they would need to be investigated on a case-by-case basis.
  3. 3.The documentation highlighted the ability to run applications across multiple availability zones for redundancy, which can help mitigate potential localized impacts.
  4. 4.If you are experiencing connectivity problems with a specific EC2 instance, I would recommend checking security groups, network access control lists, and considering stopping and restarting the instance to place it on different hardware, as described in the search results.
  5. 5.For any issues with a particular AWS service, it's generally best to check the AWS Service Health Dashboard or open a support case for assistance.

Let me know if you have any other questions! Otherwise I would suggest verifying configuration details as noted above or reviewing the service health dashboard for the Tokyo region.

→ AWS自体の障害情報についてはリアルタイムで回答してくれました。

6.このアカウント内のリソースに障害は発生していますか?

To check if any resources in your AWS account are experiencing failures:

  1. 1.Check the AWS Service Health Dashboard at status.aws.amazon.com for any current issues or events that may be affecting resources.
  2. 2.Check for system status check errors on EC2 instances or volume status check errors on EBS volumes. These could indicate resource failures at the Availability Zone level.
  3. 3.Review logs for your resources and applications for any error messages that may help diagnose issues.
  4. 4.Check CloudWatch metrics and alarms for your resources to see if any are indicating abnormal or failed states.
  5. 5.Verify resource statuses using the AWS CLI:
aws ec2 describe-instances
aws ec2 describe-volumes
Let me know if any specific resources appear to be failing or not functioning correctly. The AWS documentation also has additional steps for troubleshooting resource issues.

→ アカウント内の障害情報は教えてくれませんが、その調査方法は教えてくれました。

7. 東京リージョンで稼働する Windows m5.large EC2インスタンスの時間単価を教えてください。

The hourly price for a Windows m5.large EC2 instance running in the Tokyo region would depend on the current on-demand pricing for that instance type and region. Pricing can vary over time so for the most accurate information, I'd recommend checking the EC2 pricing page on the AWS website.

Some key factors that influence EC2 pricing include the instance type, region, platform (Windows vs Linux), and whether additional features like EBS optimization or dedicated EBS volumes are enabled. The pricing page allows you to filter by these attributes to find the exact configuration you need. It's usually best to start with a general purpose instance like m5.large for most workloads, but you can also consider optimized instance families like c5 or r5 depending on your requirements.

I hope this helps provide some context on where to find the most current pricing information for your EC2 needs. Let me know if you have any other questions!

→ リストプライスについては答えてくれないようです。

8. 以下のエラーメッセージの意味を教えてください。

The error message indicates that the IAM user JohnDoe does not have permissions to perform the codecommit:ListRepositories action. This is because there is no identity-based policy attached to the user that allows this action.

To resolve this, an identity-based policy needs to be attached to the IAM user that grants permissions for the codecommit:ListRepositories action.

Some options to address this include:
  1. 1.Attach a managed policy like AWSCodeCommitPowerUser to the IAM user. This policy grants permissions for common CodeCommit actions including listing repositories.
  2. 2.Create a custom identity-based policy for the IAM user with the following JSON policy document:
    
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow", 
            "Action": [
              "codecommit:ListRepositories"
            ],
            "Resource": "*"
          }
        ]
      }
    
  3. 3.Edit an existing identity-based policy attached to the user to include an "Allow" statement for the codecommit:ListRepositories action.

→ エラーメッセージを解釈して、対策まで提示してくれました。

9. このアカウントの現在の利用料金を教えてください

To find your current usage and costs for this AWS account, you can check the Cost Explorer tool in the AWS Billing Console.

Sign in to the AWS Billing Console and select "Cost Explorer" from the left-hand menu (link) .

On the Cost Explorer dashboard, you can view your total AWS costs by service over the current month or a custom date range. It will break down your costs by individual service (EC2, S3, etc) to help identify top cost drivers.

You can also change the chart type (e.g. to "stack") to better compare usage across services.

Make sure to regularly review your costs and usage reports in Cost Explorer to track your AWS spending and usage over time.

→ 料金に関してもこのアカウント内の情報は教えてくれず、調査方法を教えてくれました。

10. データベース識別子IDXXXのセキュリティを強化するためのアドバイスをください。

Here are some recommendations to increase the security of your database identifier testdb-1:

Restrict access to the database by creating IAM roles with granular permissions and attaching those roles only to trusted entities that need access. For example, create a role for a web application with only select/insert permissions.

Enforce SSL/TLS connections to the database to encrypt traffic. You can do this by creating an RDS instance with a certificate issued by an ACM Private Certificate Authority.

Use IAM database authentication instead of storing database credentials in your application code. With IAM auth, the application uses the IAM role for database operations instead of a username/password.

Implement database auditing to log all queries and connections. You can set up a CloudWatch Logs subscription for your RDS instance to centrally monitor and alert on suspicious activity.

Consider using a database security tool like AWS Shield Advanced or Amazon RDS WAF to detect and block common exploits and attacks. These services monitor your database for anomalies and unusual traffic patterns.

Restrict network access to your database instance by creating security groups that allow connections only from your application servers. Please refer to the AWS documentation for more details on using Cost Explorer and understanding your AWS bill. Let me know if you have any other questions!

→ こちらはこれまでの結果からすると意外にも具体的な回答が得られました。

11. このアカウントで購入するCompute Savings Plansの推奨値を教えてください。

Based on the usage patterns and costs for your account, I would recommend the following approach to Savings Plans:

Start with Compute Savings Plans. These provide the most flexibility to adjust your instance types, families, sizes and regions without losing your savings. Compute Savings Plans can save you up to 66% compared to on-demand prices.

Consider supplementing Compute Savings Plans with additional savings from EC2 Instance Savings Plans for specific instance families you know you will use heavily in a particular region. EC2 Instance Savings Plans offer even lower prices, up to 72% savings, but less flexibility to change instance attributes.

Review your Savings Plan recommendations regularly in AWS Cost Explorer. As your usage changes over time, new recommendations may suggest different Savings Plan levels or types to optimize your savings.

Consider a 1-year term for your initial Savings Plans purchase to keep options flexible as your needs may change, then switch to 3-year terms later once usage is more stable.

Pay either partially or fully upfront to get the lowest possible Savings Plan rates, if your budget allows.

Let me know if you have any other questions! AWS documentation provides all the latest pricing details to help you evaluate your options.

→ こちらも具体的な推奨値は教えてくれず、調査方法を教えてくれました。

12. 現在契約しているサポートプランを教えてください。

I do not have direct knowledge of which AWS support plan I am subscribed to. However, based on my knowledge of typical AWS usage, most AWS customers subscribe to one of the following support plans:

  1. 1.Basic plan: This free support plan provides access to AWS online support centers and forums. It is suitable for non-production or testing workloads with lower priority support cases.
  2. 2.Developer plan: This plan provides email support during business hours with a 12-hour response time for non-production systems. It is well-suited for development, testing and early adoption of AWS services.
  3. 3.Business plan: This plan provides 24x7 chat, phone and email access to AWS support engineers with 1-hour response time for production systems and business-critical applications. It ensures adequate support coverage for mission-critical workloads.
Customers can compare these plans on the AWS Support plans page and choose the one that best matches their support needs based on factors like workload priority, response time requirements and business hours. Reach out to AWS Support for any other questions regarding available plans or pricing.

→ こちらも教えてはくれませんでした。

13. このアカウントはどの国の法律に準拠していますか?

This account would comply with Luxembourg laws. According to the documentation, for AWS training held in many different countries, the contracting entity is Amazon Web Services EMEA SARL which is based in Luxembourg. The laws of Luxembourg would govern any disputes related to AWS training for those countries.

→ Affiliateを見ているんですかね?アカウント情報的には合っていますが、実体とは異なる結果でした。

4.まとめ

3章の結果をまとめる以下の通りでした。

ジャンル 質問内容 目的 結果
1 操作方法 EC2で利用中のEBSボリュームを暗号化する方法は? 一般的な質問に回答可能か?
2 操作方法 AWS CLIでセキュリティグループに新しい許可を追加するコマンドを教えてください。 AWS CLIを用いた具体的な設定までアシスト可能か?
3 情報収集 東京リージョンで稼働しているEC2インスタンスを教えてください。 自分のアカウント内の情報を収集してくれるか?
4 情報収集 インスタンスID XXXのディスク容量を教えてください。 利用中のアカウント内のリソースに関する情報を調べることは可能か?
5 障害 東京リージョンで現在障害は発生していますか?8000 AWS自体の障害が調査可能か?
6 障害 このアカウント内のリソースに障害は発生していますか? アカウント内の障害が調査可能か?
7 障害 以下のエラーメッセージの意味を教えてください。 エラーメッセージの意味と対処法を確認可能か?
8 料金 東京リージョンで稼働する Windows m5.large EC2インスタンスの時間単価を教えてください。 AWSリソースの時間単価を調査可能か?
9 料金 このアカウントの現在の利用料金を教えてください。 利用中のアカウントの利用料金は調査可能か?
10 リコメンド データベース識別子IDXXXのセキュリティを強化するためのアドバイスをください。 利用中のアカウントのリソースに対する推奨事項提示が可能か?
11 リコメンド このアカウントで購入するCompute Savings Plansの推奨値を教えてください。 利用中のアカウントのコスト最適化の推奨値の提示が可能か?
12 契約 現在契約しているサポートプランを教えてください。 AWSと契約いているサポートプランが確認できるか?
13 契約 このアカウントはどの国の法律に準拠していますか? 利用中のアカウントからCAがどの様に適用されているか確認できるか?

以上の結果から、Amazon Q (for builder Use)は以下の対応については非常に有効なツールと言えます。

  1. ①AWS環境の操作方法(GUI,CLI問わず)に対するアシスタント
  2. ②一般的なエラーに対するトラブルシューティングのアシスタント

一方でアカウント内のリソースに関する情報は取得してくれないようですので、アカウント内の情報のサマライズやアカウント内部の情報を使ったアドバイスはほとんど期待できないというのが現状の様です。ただ、情報の収集方法などを提示してくれるので、全く使えないという訳ではないようですが。それから度々結果に出力されていましたが、VPC Reachability Analyzerと連携するAmazon Q network troubleshootingによって環境に合わせたネットワーク関連の障害対応や推奨事項を提示する機能がAmazon Q (for builder Use)の外で実行可能です。

当面はAWS環境の設定・操作で確認したい場合に最大限有効活用し、環境固有の対応についてはAmazon Q network troubleshootingの様に、Amazon Q自体の機能拡張が行われるのを待つのが妥当と考えられます。

CTCは、AWSのビジネス利活用に向けて、お客様のステージに合わせた幅広い構築・運用支援サービスを提供しています。
経験豊富なエンジニアが、ワンストップかつ柔軟にご支援します。
ぜひ、お気軽にお問い合わせください。

お問い合わせ



【著者プロフィール】

高橋 繁義(たかはし しげよし)

伊藤忠テクノソリューションズ株式会社 クラウドアーキテクト

インフラ全般のエンジニアとして20年以上活動し、現在AWS専任の技術担当兼サービス企画担当として活動中
2022年から2年連続でAPN Ambassadorに選任

高橋 繁義(たかはし しげよし)

TOP>コラム一覧>Amazon Q (AWS builder use)について何ができるか調べてみた

pagetop