🤖 AI/ML

Amazon Q

AWS's generative AI assistant

📖 Detailed Explanation

Amazon Q is an enterprise generative AI assistant that AWS announced at re:Invent in 2023. It consists of Amazon Q Developer for developers, Amazon Q Business for business users, and specialized services such as Amazon Q in QuickSight. It combines AWS's extensive cloud knowledge with customer data to provide customized responses.

It is AWS's strategic AI product that competes with Microsoft Copilot and Google Duet AI. It became generally available in April 2024, absorbed the existing CodeWhisperer features, and was integrated across AWS services. It has cloud expertise gained by learning from 17 years of technical documentation and best practices accumulated within the AWS ecosystem.

Amazon Q Developer supports code generation, bug fixing, security vulnerability detection, and automated Java version upgrades within the IDE. Amazon Q Business connects internal enterprise data (S3, SharePoint, Salesforce, and more than 40 other connectors) to provide internal knowledge search and work automation.

When you ask in the AWS console, "How can I optimize the cost of this EC2?", it analyzes current usage patterns and recommends Reserved Instances or Savings Plans. Developers can get immediate optimization guidance with questions such as "How can I reduce the cold start of this Lambda function?"

💻 Code Example

# Amazon Q Developer를 활용한 코드 생성 예시
# IDE에서 주석을 작성하면 Q가 코드를 자동 생성

# TODO: S3에서 파일을 다운로드하고 DynamoDB에 메타데이터 저장
# Amazon Q가 아래 코드를 자동 생성:

import boto3
from datetime import datetime

def process_s3_file(bucket: str, key: str, table_name: str):
    """S3 파일을 다운로드하고 DynamoDB에 메타데이터 저장"""
    s3 = boto3.client('s3')
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table(table_name)

    # S3에서 파일 다운로드
    response = s3.get_object(Bucket=bucket, Key=key)
    file_content = response['Body'].read()

    # 메타데이터 추출
    metadata = {
        'file_key': key,
        'bucket': bucket,
        'size': response['ContentLength'],
        'last_modified': response['LastModified'].isoformat(),
        'processed_at': datetime.utcnow().isoformat()
    }

    # DynamoDB에 저장
    table.put_item(Item=metadata)

    return file_content, metadata

# Amazon Q에게 "이 코드의 에러 핸들링을 추가해줘"라고 요청하면
# try-except 블록과 재시도 로직을 자동으로 추가

# Amazon Q CLI 사용 예시 (터미널에서)
# $ q chat "EC2 인스턴스 t3.medium과 t3.large의 가격 차이는?"
# $ q transform --source-code ./legacy --target-version java17

🗣️ Examples of Practical Conversations

📊 In a cloud cost optimization meeting

"In the AWS console, ask Amazon Q about 'the cause of this month's cost spike.' It analyzes Cost Explorer data and tells you which services increased and by how much, along with optimization options. It's much faster than digging through the dashboards yourself."

💼 In a development team tool selection meeting

"Consider Amazon Q Developer instead of GitHub Copilot. Q is more accurate at generating code for AWS services, and it also does a good job with IAM policies and CloudFormation templates. However, Copilot may be better for general coding."

🔧 In a migration project

"We're upgrading from Java 8 to 17, so try Amazon Q's Code Transformation. It automatically analyzes thousands of files, finds the parts that need to change, and even creates the Pull Request. Doing it manually would take months."

⚠️ Cautions

💰
Be sure to check the pricing structure

Amazon Q Developer has a Free Tier (limited) and a Pro Tier ($19/user per month). Q Business is divided into Lite ($3 per month) and Pro ($20 per month). Costs vary greatly depending on team size, so advance calculation is necessary.

🔐
Data privacy settings

When connecting internal documents with Q Business, configure IAM permissions and the scope of data access carefully. Sensitive information may be exposed unintentionally, and enabling audit logs is recommended.

🌍
Region availability

Not all Amazon Q features are available in every AWS Region. In particular, some Q Business connectors are supported only in specific Regions such as us-east-1, so advance verification is necessary.

🔗 Related Terms

📚 Learn More