aws-api-gateway
Skill274 starsChanged 28 days agoMITView on GitHub
AWS API Gateway for REST and HTTP API management. Use when creating APIs, configuring integrations, setting up authorization, managing stages, implementing rate limiting, or troubleshooting API issues.
In this repository53 other files it gives its agents.
- website/docs/authoring/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .github/skills/git-ape-onboarding/templates/copilot-instructions.mdCopilot instructions
- aws-bedrockSkill
- aws-cloudformationSkill
- aws-cloudwatchSkill
- aws-cognitoSkill
- aws-cost-estimatorSkill
- aws-dynamodbSkill
- aws-ec2Skill
- aws-ecsSkill
- aws-eksSkill
- aws-eventbridgeSkill
- aws-iamSkill
- aws-lambdaSkill
- aws-naming-researchSkill
- aws-rdsSkill
- aws-s3Skill
- aws-secrets-managerSkill
- aws-security-analyzerSkill
- aws-snsSkill
- aws-sqsSkill
- aws-step-functionsSkill
- csd-assessment-reportSkill
- deployment-blueprintsSkill
- fulfillment-and-meteringSkill
- isv-landing-zone-foundationSkill
- marketplace-offer-typesSkill
- marketplace-onboardingSkill
- multi-tenant-saasSkill
- onboard-to-marketplaceSkill
- saas-accelerator-bootstrapSkill
- saas-assessment-reportSkill
- scale-and-sreSkill
- security-and-complianceSkill
- tenant-isolation-modelsSkill
- tenant-lifecycle-automationSkill
- azure-cost-estimatorSkill
- azure-deployment-preflightSkill
- azure-drift-detectorSkill
- azure-integration-testerSkill
- azure-naming-researchSkill
- azure-policy-advisorSkill
- azure-resource-availabilitySkill
- azure-resource-visualizerSkill
- azure-rest-api-referenceSkill
- azure-role-selectorSkill
- azure-security-analyzerSkill
- azure-stack-deploySkill
- azure-stack-destroySkill
- git-ape-onboardingSkill
- git-ape-skillsSkill
- prereq-checkSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 276
Use async processing for long operations
- Distinctive: line 281
Check OPTIONS method exists
- Distinctive: line 282
Verify headers in response
- Distinctive: line 283
Check origin matches allowed origins
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS API Gateway
Amazon API Gateway is a fully managed service for creating, publishing, and securing APIs at any scale. Supports REST APIs, HTTP APIs, and WebSocket APIs.
Table of Contents
- Core Concepts
- Common Patterns
- CLI Reference
- Best Practices
- Troubleshooting
- References
Core Concepts
API Types
| Type | Description | Use Case |
| HTTP API | Low-latency, cost-effective | Simple APIs, Lambda proxy |
| REST API | Full-featured, more control | Complex APIs, transformation |
| WebSocket API | Bidirectional communication | Real-time apps, chat |
Key Components
- Resources: URL paths (/users, /orders/{id})
- Methods: HTTP verbs (GET, POST, PUT, DELETE)
- Integrations: Backend connections (Lambda, HTTP, AWS services)
- Stages: Deployment environments (dev, prod)
Integration Types
| Type | Description |
| Lambda Proxy | Pass-through to Lambda (recommended) |
| Lambda Custom | Transform request/response |
| HTTP Proxy | Pass-through to HTTP endpoint |
| AWS Service | Direct integration with AWS services |
| Mock | Return static response |
Common Patterns
Create HTTP API with Lambda
AWS CLI:
# Create HTTP API
aws apigatewayv2 create-api \
--name my-api \
--protocol-type HTTP \
--target arn:aws:lambda:us-east-1:123456789012:function:MyFunction
# Get API endpoint
aws apigatewayv2 get-api --api-id abc123 --query 'ApiEndpoint'SAM Template:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
StageName: prod
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Runtime: python3.12
Events:
ApiEvent:
Type: HttpApi
Properties:
ApiId: !Ref MyApi
Path: /items
Method: GETCreate REST API with Lambda Proxy
# Create REST API
aws apigateway create-rest-api \
--name my-rest-api \
--endpoint-configuration types=REGIONAL
API_ID=abc123
# Get root resource ID
ROOT_ID=$(aws apigateway get-resources --rest-api-id $API_ID --query 'items[0].id' --output text)
# Create resource
aws apigateway create-resource \
--rest-api-id $API_ID \
--parent-id $ROOT_ID \
--path-part items
RESOURCE_ID=xyz789
# Create method
aws apigateway put-method \
--rest-api-id $API_ID \
--resource-id $RESOURCE_ID \
--http-method GET \
--authorization-type NONE
# Create Lambda integration
aws apigateway put-integration \
--rest-api-id $API_ID \
--resource-id $RESOURCE_ID \
--http-method GET \
--type AWS_PROXY \
--integration-http-method POST \
--uri arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:123456789012:function:MyFunction/invocations
# Deploy to stage
aws apigateway create-deployment \
--rest-api-id $API_ID \
--stage-name prodLambda Handler for API Gateway
import json
def handler(event, context):
http_method = event.get('requestContext', {}).get('http', {}).get('method')
path = event.get('rawPath', '')
query_params = event.get('queryStringParameters', {})
body = event.get('body', '')
if body and event.get('isBase64Encoded'):
import base64
body = base64.b64decode(body).decode('utf-8')
response_body = {'message': 'Success', 'path': path}
return {
'statusCode': 200,
'headers': {
'Content-Type': 'application/json'
},
'body': json.dumps(response_body)
}Configure CORS
HTTP API:
aws apigatewayv2 update-api \
--api-id abc123 \
--cors-configuration '{
"AllowOrigins": ["https://example.com"],
"AllowMethods": ["GET", "POST", "PUT", "DELETE"],
"AllowHeaders": ["Content-Type", "Authorization"],
"MaxAge": 86400
}'JWT Authorization (HTTP API)
aws apigatewayv2 create-authorizer \
--api-id abc123 \
--name jwt-authorizer \
--authorizer-type JWT \
--identity-source '$request.header.Authorization' \
--jwt-configuration '{
"Issuer": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_abc123",
"Audience": ["client-id"]
}'CLI Reference
HTTP API (apigatewayv2)
| Command | Description |
aws apigatewayv2 create-api | Create API |
aws apigatewayv2 get-apis | List APIs |
aws apigatewayv2 create-route | Create route |
aws apigatewayv2 create-integration | Create integration |
aws apigatewayv2 create-stage | Create stage |
aws apigatewayv2 create-authorizer | Create authorizer |
REST API (apigateway)
| Command | Description |
aws apigateway create-rest-api | Create API |
aws apigateway get-rest-apis | List APIs |
aws apigateway create-resource | Create resource |
aws apigateway put-method | Create method |
aws apigateway put-integration | Create integration |
aws apigateway create-deployment | Deploy API |
Best Practices
Performance
- Use HTTP APIs for simple use cases (70% cheaper, lower latency)
- Enable caching for REST APIs
- Use regional endpoints unless global distribution needed
Security
- Use authorization on all endpoints
- Enable WAF for REST APIs
- Enable access logging
- Use HTTPS only
Reliability
- Set up throttling to protect backends
- Configure timeout appropriately
- Monitor with CloudWatch
Troubleshooting
403 Forbidden
Causes:
- Missing authorization
- Invalid API key
- WAF blocking
- Resource policy denying
502 Bad Gateway
Causes:
- Lambda error
- Integration timeout
- Invalid response format
Lambda response format:
# Correct format
return {
'statusCode': 200,
'headers': {'Content-Type': 'application/json'},
'body': json.dumps({'message': 'success'})
}
# Wrong - missing statusCode
return {'message': 'success'}504 Gateway Timeout
Causes:
- Backend timeout (Lambda max 29 seconds for REST API)
- Integration timeout too short
Solutions:
- Increase Lambda timeout
- Use async processing for long operations
CORS Errors
Debug:
- Check OPTIONS method exists
- Verify headers in response
- Check origin matches allowed origins
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

