deploying-custom-domain-rest-api

Deploys a Regional REST API with custom domain, Lambda backend, and request authorizer via AWS CLI.

2.5k|282|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill deploying-custom-domain-rest-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deploying-custom-domain-rest-api
Source: https://github.com/aws/agent-toolkit-for-aws/tree/main/skills/specialized-skills/serverless-skills/deploying-custom-domain-rest-api
Command: npx skills add https://github.com/aws/agent-toolkit-for-aws --skill deploying-custom-domain-rest-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Setting up an API Gateway REST API with a custom domain, TLS certificate, Lambda backend, and request-based authorization involves many error-prone manual steps across ACM, IAM, Lambda, API Gateway, and Route 53. This Skill automates the entire deployment sequence with validated AWS CLI commands.

Core Features & Use Cases

  • End-to-end provisioning: Requests and validates an ACM certificate, creates IAM execution roles, deploys two Lambda functions (authorizer and backend), and configures the REST API with a REQUEST-type Lambda authorizer.
  • Custom domain and DNS setup: Creates the Regional custom domain with TLS 1.2, maps the base path to the API stage, and creates a Route 53 A-alias record.
  • Validation and troubleshooting: Includes a validation script that checks DNS propagation, API configuration, Lambda state, and performs a live authorized request test.
  • Use Case: A developer needs to expose an internal service at api.example.com with header and query-string based authorization; this Skill walks through every AWS CLI command and verifies the final endpoint responds correctly.

Quick Start

Ask the agent to deploy a custom domain REST API by providing your domain name, AWS region, and Route 53 hosted zone ID.

Frequently Asked Questions about deploying-custom-domain-rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy an API Gateway REST API with a custom domain using AWS CLI?

Request an ACM certificate in the same region, create the REST API with a Regional endpoint, deploy it to a stage, then run aws apigateway create-domain-name with the certificate ARN and create a base path mapping. Finally, add a Route 53 A-alias record pointing to the regional domain name.

How to set up a request-based Lambda authorizer for API Gateway?

Create a Lambda function that inspects headers, query strings, and stage variables, then register it with aws apigateway create-authorizer using type REQUEST and an identity source listing the request parameters. Grant API Gateway invoke permission on the function and attach the authorizer to your method with authorization-type CUSTOM.

Does this skill support private API Gateway endpoints?

No, this skill covers Regional endpoints only. Private endpoints require VPC endpoint configuration, which is outside the scope of this deployment workflow.

Why is my ACM certificate stuck in PENDING_VALIDATION?

The DNS validation CNAME record may be missing or created in the wrong hosted zone. Check the record with aws acm describe-certificate and confirm the CNAME exists in Route 53, then retry the aws acm wait certificate-validated command.

Why does my API return 403 Forbidden after deployment?

The request authorizer requires HeaderAuth1 to equal headerValue1, QueryString1 to equal queryValue1, and stage variable StageVar1 to equal stageValue1. Verify all three values and check the authorizer function's CloudWatch Logs for details.

Are the hardcoded authorizer values safe for production?

No, the demo values headerValue1, queryValue1, and stageValue1 are not suitable for production. Replace them with credentials managed in AWS Secrets Manager or Systems Manager Parameter Store before going live.