/john-skills:aws-quick-endpointfrom john-skills
Creates a token-secured REST API endpoint with AWS Lambda, DynamoDB, and API Gateway, deployed via CloudFormation. Useful for quickly spinning up CRUD APIs on AWS.
Ships in john-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Deploy a token-secured REST API (API Gateway HTTP API + Lambda + DynamoDB) with full CRUD and paginated list operations via CloudFormation. Everything is IaC.
The auth token lives only in AWS Secrets Manager. The stack generates it, so it never passes through a template parameter or a file.
USAGE.md. Files reference the secret ARN and fetch the token at run time.This way the skill's output is safe to commit no matter which directory or repo it runs in.
Ask user for:
pets, logs, records). Must be lowercase, letters/numbers/hyphens only.id): The DynamoDB primary key field nameGenerate unique names using profile and timestamp:
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
STACK_NAME="quick-ep-${RESOURCE_NAME}-${AWS_PROFILE}-${TIMESTAMP}"
Copy template from skill assets to working directory, then deploy:
cp <skill-assets>/cloudformation-quick-endpoint.yaml .
aws cloudformation create-stack \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME \
--template-body file://cloudformation-quick-endpoint.yaml \
--capabilities CAPABILITY_NAMED_IAM \
--parameters \
ParameterKey=ResourceName,ParameterValue=$RESOURCE_NAME \
ParameterKey=PartitionKey,ParameterValue=${PARTITION_KEY:-id}
Important: --capabilities CAPABILITY_NAMED_IAM is required because the template creates an IAM role for the Lambda function.
aws cloudformation wait stack-create-complete \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME
aws cloudformation describe-stacks \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME \
--query 'Stacks[0].Outputs' \
--output table
Extract ResourceEndpoint and AuthTokenSecretArn from the outputs. The token itself is not an output.
Fetch the token into a shell variable (do not echo it), then run a quick smoke test. Use the resource name and partition key from step 1:
API_URL="<ResourceEndpoint output value>"
SECRET_ARN="<AuthTokenSecretArn output value>"
AUTH_TOKEN=$(aws secretsmanager get-secret-value \
--profile $AWS_PROFILE \
--secret-id "$SECRET_ARN" \
--query SecretString --output text)
# Create a record
curl -s -X POST "$API_URL" \
-H "Content-Type: application/json" \
-H "x-api-token: $AUTH_TOKEN" \
-d '{"name": "test-record"}'
# List records (paginated)
curl -s "$API_URL?limit=10" \
-H "x-api-token: $AUTH_TOKEN"```
Verify both return 200/201 with valid JSON. If the create returns a record with an auto-generated `id`, `created_at`, and `updated_at`, the endpoint is working.
### 6. Provide Usage Info
**IMPORTANT:** Always write a markdown file called `USAGE.md` in the working directory with ready-to-copy curl examples using the actual URL, secret ARN, profile, and stack name from this deployment. The user should be able to paste commands directly into their terminal without editing. **Never put the token value in this file** — the Setup block fetches it from Secrets Manager.
Use this template, substituting all `<placeholders>` with real values from the deployment:
```markdown
# <Resource Name> API
**Endpoint:** `<ResourceEndpoint URL>`
**Auth token:** stored in Secrets Manager at `<AuthTokenSecretArn>`
## Setup
```bash
URL="<actual ResourceEndpoint URL>"
TOKEN=$(aws secretsmanager get-secret-value --profile <profile> \
--secret-id "<AuthTokenSecretArn>" --query SecretString --output text)
curl -s -X POST "$URL" \
-H "Content-Type: application/json" \
-H "x-api-token: $TOKEN" \
-d '{"name": "example"}'```
Omit `id` and one is auto-generated. `created_at` and `updated_at` are added automatically.
## List all (paginated)
```bash
curl -s "$URL?limit=25" -H "x-api-token: $TOKEN"```
If `next_token` appears in the response, pass it to get the next page:
```bash
curl -s -G "$URL" --data-urlencode "limit=25" \
--data-urlencode "next_token=<TOKEN_FROM_RESPONSE>" \
-H "x-api-token: $TOKEN"```
## Get one
```bash
curl -s "$URL/<id>" -H "x-api-token: $TOKEN"```
## Update
```bash
curl -s -X PUT "$URL/<id>" \
-H "Content-Type: application/json" \
-H "x-api-token: $TOKEN" \
-d '{"name": "updated"}'```
PUT is a full replace — send all fields you want to keep. `created_at` is preserved, `updated_at` is refreshed.
## Delete
```bash
curl -s -X DELETE "$URL/<id>" -H "x-api-token: $TOKEN"```
## Notes
- **CORS:** Enabled for all origins — safe to call from browser JavaScript
- **Limits:** Max body 10KB, max nesting depth 5, max 50 attributes per level
- **Pagination tokens** are HMAC-signed and tamper-proof
- **Rotating the auth token:** run the command below. The API accepts the new token within 5 minutes, and existing pagination tokens stop working.
```bash
aws secretsmanager put-secret-value --profile <profile> --secret-id "<AuthTokenSecretArn>" \
--secret-string "$(aws secretsmanager get-random-password --profile <profile> \
--password-length 40 --exclude-punctuation --query RandomPassword --output text)"
Warning: This permanently deletes the DynamoDB table and all data, the auth token secret, and the logs.
aws cloudformation delete-stack --profile <profile> --stack-name <stack-name>
After writing the file, tell the user: `Usage examples saved to USAGE.md`
### 7. Done
The `USAGE.md` from step 6 contains everything the user needs: URL, how to fetch the token, curl examples, and cleanup command. No separate info file is needed. Before finishing, confirm the token value appears in no file you wrote.
## Cleanup
Delete all AWS resources by deleting the CloudFormation stack:
```bash
aws cloudformation delete-stack \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME
aws cloudformation wait stack-delete-complete \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME
Warning: This permanently deletes the DynamoDB table and all its data, the auth token secret, and the Lambda log group. All three are owned by the stack, so nothing is left behind.
Stack updates don't change the token. It lives in Secrets Manager, not in a template parameter, so there's nothing to re-supply.
Located at: assets/cloudformation-quick-endpoint.yaml
Creates:
LogRetentionDays parameter), so deleting the stack deletes the logs instead of orphaning themWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
aws-lambda, dynamodb, api-gateway, cloudformation, rest-api, crud
32 skills in this plugin
/architecture-decision-recordsWrite and maintain Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions. Use when documenting an architectural or technology choice, recording a design trade-off, superseding a past decision, or setting up an ADR process. Also use proactively to offer an ADR when a significant decision is made during a coding session (database, framework, auth scheme, API style, integration pattern). Triggers on "write an ADR", "document this decision", "record this architecture choice", "add a decision record", "supersede ADR"./aws-learningsProactively catch common AWS infrastructure mistakes before they happen. Use when creating or modifying AWS components — CloudFormation, CDK, Lambda, API Gateway, IAM, S3, CloudFront, EC2, EventBridge, SQS, Secrets Manager, or SSM — to find and apply hard-won deployment lessons and avoid known pitfalls. Read-only: fetches lessons, does not add them./aws-learnings-addContribute a new lesson to the AWS Learnings library (the llms.txt-format library at github.com/jbdamask/aws-learnings-library). Use this whenever you've just debugged, fixed, or discovered a non-obvious AWS gotcha — CloudFormation, CDK, Lambda, API Gateway, IAM, S3, CloudFront, EC2, EventBridge, SQS, Secrets Manager, SSM — and want to capture it for next time. Triggers on phrases like 'add an AWS learning', 'save this AWS lesson', 'capture this gotcha', 'add this to the learnings library', or after solving a tricky AWS deployment problem worth remembering. This skill WRITES files (a new lesson file + an updated index) and prepares a pull request; it is the write companion to the read-only 'aws-learnings' skill.npx claudepluginhub jbdamask/john-claude-skills --plugin john-skillsOther plugins' skills for the same job