Logo Aws Serverless

Aws Serverless

Cộng đồng
Omar-Obando
aws-serverless

Use when developing and deploying AWS serverless applications, configuring Lambda functions, API Gateway, SAM templates, and optimizing serverless performance. Includes Lambda best practices, API Gateway configuration, and serverless architecture patterns. Based on AWS Certified Solutions Architect and AWS Certified Developer certifications.

Add to TypingMind

Tổng quan

Nhà phát hànhOmar-Obando
Kho mãqwen-orchestrator
Tên kỹ năngaws-serverless
Sao
53
Bản fork
13
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Omar-Obando công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Aws Serverless trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/aws-serverless
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/aws-serverless .claude/skills/aws-serverless
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Aws Serverless trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Aws Serverless ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Aws Serverless với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

AWS Serverless Skill — Lambda, API Gateway & SAM

Overview

This skill provides comprehensive guidance for developing and deploying AWS serverless applications, configuring Lambda functions, API Gateway, SAM templates, and optimizing serverless performance. It includes Lambda best practices, API Gateway configuration, and serverless architecture patterns. Based on AWS Certified Solutions Architect and AWS Certified Developer certifications.

When to Use

Use this skill when:

  • Developing AWS Lambda functions for event-driven architectures
  • Configuring API Gateway endpoints with proper authorization and integration
  • Using SAM for infrastructure as code and serverless deployments
  • Optimizing serverless performance (cold starts, memory, execution time)
  • Implementing serverless architecture patterns (CQRS, Event Sourcing, Saga)
  • Configuring event-driven architectures (S3, SQS, EventBridge, Kinesis)
  • Deploying with AWS Well-Architected Framework principles
  • Implementing CI/CD for serverless applications
  • Managing serverless costs and resource optimization

Do NOT use this skill when:

  • Writing application business logic (use developer skill)
  • Designing database schema (use database-design skill)
  • Creating UI components (use frontend-design skill)
  • Managing non-AWS cloud infrastructure (use vercel-deployment, cloudflare-pages, cloudflare-workers, azure-cloud, or gcp-cloud skills)
  • Performing security audits (use security-auditor skill)
  • Setting up Kubernetes deployments (use devops-pipeline skill)

Why avoid: AWS Serverless is specific to AWS Lambda and SAM. For other cloud platforms or infrastructure, use targeted skills.

AWS SAM Template

Basic SAM Template

yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Simple serverless application

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs18.x
      CodeUri: src/
      Events:
        HelloWorld:
          Type: Api
          Properties:
            Path: /hello
            Method: get

Outputs:
  ApiUrl:
    Description: API Gateway endpoint URL
    Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello'

Advanced SAM Template

yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Advanced serverless application

Globals:
  Function:
    Timeout: 10
    MemorySize: 512
    Runtime: nodejs18.x
    Environment:
      Variables:
        NODE_ENV: production

Resources:
  UsersFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: users.handler
      CodeUri: src/users/
      Events:
        GetUsers:
          Type: Api
          Properties:
            Path: /users
            Method: get
        CreateUser:
          Type: Api
          Properties:
            Path: /users
            Method: post
      Environment:
        Variables:
          DB_TABLE: !Ref UsersTable
      Policies:
        - DynamoDBReadPolicy:
            TableName: !Ref UsersTable
        - DynamoDBWritePolicy:
            TableName: !Ref UsersTable

  UsersTable:
    Type: AWS::Serverless::SimpleTable
    Properties:
      PrimaryKey:
        Name: userId
        Type: String

  EventsFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: events.handler
      CodeUri: src/events/
      Events:
        S3Event:
          Type: S3
          Properties:
            Bucket: !Ref UploadBucket
            Events: s3:ObjectCreated:*
      Environment:
        Variables:
          NOTIFICATION_QUEUE: !Ref NotificationQueue

  UploadBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Sub '${AWS::StackName}-uploads'

  NotificationQueue:
    Type: AWS::SQS::Queue

Outputs:
  UsersApiUrl:
    Description: Users API endpoint URL
    Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/users'

Lambda Best Practices

Cold Start Optimization

javascript
// ✅ GOOD: Cold start optimization
let cachedData = null;

exports.handler = async (event) => {
  // Initialize expensive resources once (outside handler)
  if (!cachedData) {
    cachedData = await initializeExpensiveResource();
  }

  // Handler logic
  return {
    statusCode: 200,
    body: JSON.stringify({ data: cachedData }),
  };
};

async function initializeExpensiveResource() {
  // Initialize expensive resource
  return { initialized: true };
}

Minimal Dependencies

javascript
// ✅ GOOD: Minimal dependencies
exports.handler = async (event) => {
  // Lightweight processing
  const result = processRequest(event);
  return {
    statusCode: 200,
    body: JSON.stringify(result),
  };
};

function processRequest(event) {
  // Simple, focused logic
  return { processed: true };
}

Error Handling

javascript
// ✅ GOOD: Error handling
exports.handler = async (event) => {
  try {
    const result = await processRequest(event);
    return {
      statusCode: 200,
      body: JSON.stringify(result),
    };
  } catch (error) {
    console.error('Error processing request:', error);
    return {
      statusCode: 500,
      body: JSON.stringify({ error: 'Internal Server Error' }),
    };
  }
};

Async Handling

javascript
// ✅ GOOD: Async handling
exports.handler = async (event) => {
  // Use async/await for clarity
  const data = await fetchData();
  const processed = await processData(data);

  return {
    statusCode: 200,
    body: JSON.stringify(processed),
  };
};

async function fetchData() {
  // Fetch data
  return { data: 'value' };
}

async function processData(data) {
  // Process data
  return { processed: true };
}

API Gateway Configuration

REST API

yaml
Resources:
  UsersApi:
    Type: AWS::Serverless::Api
    Properties:
      Name: Users API
      StageName: prod
      EndpointConfiguration:
        Type: REGIONAL
      MetricsEnabled: true
      LoggingLevel: INFO
      TracingEnabled: true
      CorsConfiguration:
        AllowOrigins:
          - https://example.com
        AllowMethods:
          - GET
          - POST
          - PUT
          - DELETE
        AllowHeaders:
          - Content-Type
          - Authorization

  UsersFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        UsersApi:
          Type: Api
          Properties:
            RestApiId: !Ref UsersApi
            Path: /users
            Method: get

HTTP API

yaml
Resources:
  UsersHttpApi:
    Type: AWS::Serverless::HttpApi
    Properties:
      Name: Users HTTP API
      StageName: prod
      AccessLogSettings:
        DestinationArn: !GetAtt AccessLogQueue.Arn
        Format: '{"requestId":"$context.requestId","ip":"$context.identity.sourceIp","requestTime":"$context.requestTime","httpMethod":"$context.httpMethod","routeKey":"$context.routeKey","status":$context.status,"responseLength":$context.responseLength}'
      CorsConfiguration:
        AllowOrigins:
          - https://example.com
        AllowMethods:
          - GET
          - POST
          - PUT
          - DELETE

  UsersFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        UsersHttpApi:
          Type: HttpApi
          Properties:
            HttpApiId: !Ref UsersHttpApi
            Path: /users
            Method: get

Authorization

yaml
Resources:
  UsersFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        UsersApi:
          Type: Api
          Properties:
            Path: /users
            Method: get
            Auth:
              Authorizer: MyAuthorizer

  MyAuthorizer:
    Type: AWS::Serverless::Function
    Properties:
      Handler: authorizer.handler
      Runtime: nodejs18.x
      CodeUri: src/authorizer/
      Events:
        Authorizer:
          Type: Authorizer
          Properties:
            ApiId: !Ref UsersApi
            Name: MyAuthorizer
            AuthorizerUri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyAuthorizer.Arn}/invocations'
            IdentitySource: method.request.header.Authorization

Event-Driven Architecture

S3 Event

yaml
Resources:
  UploadBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Sub '${AWS::StackName}-uploads'

  ProcessUploadFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: process.handler
      Runtime: nodejs18.x
      CodeUri: src/process/
      Events:
        S3Event:
          Type: S3
          Properties:
            Bucket: !Ref UploadBucket
            Events: s3:ObjectCreated:*
            Filter:
              S3Key:
                S3KeyRule:
                  Rules:
                    - prefix: uploads/
                    - suffix: .json

SQS Event

yaml
Resources:
  ProcessingQueue:
    Type: AWS::SQS::Queue
    Properties:
      VisibilityTimeout: 300
      MessageRetentionPeriod: 1209600

  ProcessQueueFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: process.handler
      Runtime: nodejs18.x
      CodeUri: src/process/
      Events:
        SQSEvent:
          Type: SQS
          Properties:
            Queue: !GetAtt ProcessingQueue.Arn
            BatchSize: 10
            MaximumBatchingWindowInSeconds: 5

EventBridge Event

yaml
Resources:
  ProcessScheduledFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: scheduled.handler
      Runtime: nodejs18.x
      CodeUri: src/scheduled/
      Events:
        ScheduledEvent:
          Type: Schedule
          Properties:
            Schedule: rate(1 hour)
            Enabled: true

Common Anti-Patterns

❌ Bad: Large Lambda Functions

javascript
// ❌ BAD: Large lambda with many dependencies
import { bigLibrary } from 'big-library';

exports.handler = async (event) => {
  // Heavy initialization
  const result = bigLibrary.process(event);
  return {
    statusCode: 200,
    body: JSON.stringify(result),
  };
};

Problems:

  • Slow cold starts
  • High memory usage
  • Expensive execution

✅ Good: Optimized Lambda

javascript
// ✅ GOOD: Optimized lambda
exports.handler = async (event) => {
  // Lightweight processing
  const result = processRequest(event);
  return {
    statusCode: 200,
    body: JSON.stringify(result),
  };
};

function processRequest(event) {
  // Simple, focused logic
  return { processed: true };
}

❌ Bad: No Error Handling

javascript
// ❌ BAD: No error handling
exports.handler = async (event) => {
  // No error handling
  const result = await processRequest(event);
  return {
    statusCode: 200,
    body: JSON.stringify(result),
  };
};

✅ Good: With Error Handling

javascript
// ✅ GOOD: With error handling
exports.handler = async (event) => {
  try {
    const result = await processRequest(event);
    return {
      statusCode: 200,
      body: JSON.stringify(result),
    };
  } catch (error) {
    console.error('Error processing request:', error);
    return {
      statusCode: 500,
      body: JSON.stringify({ error: 'Internal Server Error' }),
    };
  }
};

Real-World Impact

Before this skill:

  • Slow cold starts
  • High latency
  • Poor error handling
  • Expensive execution

After this skill:

  • Fast cold starts
  • Low latency
  • Robust error handling
  • Cost-effective functions

Cross-References

  • devops-pipeline - For CI/CD integration
  • architecture-patterns - For serverless architecture design
  • testing-strategy - For testing serverless functions

References

Câu hỏi thường gặp

Kỹ năng AI Aws Serverless làm được gì?

Use when developing and deploying AWS serverless applications, configuring Lambda functions, API Gateway, SAM templates, and optimizing serverless performance. Includes Lambda best practices, API Gateway configuration, and serverless architecture patterns. Based on AWS Certified Solutions Architect and AWS Certified Developer certifications.

Vì sao nên dùng Aws Serverless trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Aws Serverless là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Aws Serverless trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/aws-serverless. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Aws Serverless?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Aws Serverless với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Aws Serverless với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Aws Serverless có miễn phí không?

Có. Kỹ năng này được Omar-Obando phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇