Can I use AWS Certificate Manager certificates for API Gateway with Custom Domain Name
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
To integrate AWS Certificate Manager (ACM) certificates with API Gateway using a custom domain name, several technical aspects should be considered. This process involves multiple AWS services, including AWS ACM, API Gateway, and Route 53. Below, we provide a comprehensive guide detailing how to set up ACM certificates for API Gateway with a custom domain name, accompanied by examples and key points in a tabular format.
AWS Certificate Manager Overview
AWS Certificate Manager simplifies the process of managing SSL/TLS certificates for your AWS services. It helps you handle the provisioning, validation, renewal, and deployment of certificates effortlessly. This ensures encrypted data exchanges to help protect communications between clients and your API Gateway.
Using ACM Certificates with API Gateway
Prerequisites
- Custom Domain Name: You need a custom domain name registered via Route 53 or an external registrar.
- API Gateway Setup: An API created and deployed in AWS API Gateway.
- AWS ACM: Set up in your AWS account with an SSL/TLS certificate issued through ACM.
Steps to Use ACM Certificates with API Gateway
- Request a Certificate in ACM:
- Navigate to AWS ACM in the AWS Management Console.
- Request a public certificate and ensure it covers your desired domain. Use either DNS or email validation to verify domain ownership.
- Example: For a domain `api.example.com`, request a certificate that includes `api.example.com`.
- Create a Custom Domain in API Gateway:
- Open the API Gateway console and select "Custom domain names" from the left-panel.
- Click "Create" and enter your domain name.
- Choose a Regional custom domain name for HTTP APIs or a specific regional endpoint for REST APIs.
- Select the ACM certificate you've created.
- Configure DNS Settings:
- If using Route 53, automatically create an alias record that points your custom domain to the API Gateway hostname.
- For non-Route 53 domains, manually configure a CNAME record that directs traffic to the endpoint provided by API Gateway.
- Map the API Stages to the Custom Domain:
- Navigate back to the "Custom domain names" section.
- Choose your custom domain and map API stages through "API mappings."
Technical Considerations
- Certificate Validation: Ensure the domain is validated. Without successful validation, the certificate can't be deployed.
- Propagation Delay: DNS changes may take time to propagate globally. Be patient if the custom domain name doesn't resolve immediately.
- Regional Backends: Choose Regional endpoints if your API clients are spread across the globe. Use edge-optimized endpoints for regional deployments.
Example Scenario
Suppose you have a sample API running in API Gateway that you want to associate with `api.example.com`:
- Request and validate a certificate for `api.example.com`.
- Create the custom domain name and associate it with the ACM certificate.
- If using Route 53, set up an alias record for `api.example.com`:
- Record Name: `api.example.com`
- Type: A - IPv4 address
- Alias: Yes
- Target: API Gateway's provided endpoint
- Map your API Gateway stage (e.g., `prod`) to the custom domain.
Your API will now be accessible through the custom domain with the assurance of ACM-managed security.
Summary Table
Below is a summary of the core steps and considerations:
| Step | Description |
| Certificate Request | Use ACM to request a public certificate for your domain |
| Domain Validation | Validate ownership via email or DNS |
| Custom Domain Setup | Configure custom domain in API Gateway and select the ACM certificate |
| DNS Configuration | Set up appropriate DNS records using Route 53 or another provider to point to the API Gateway |
| API Mapping | Map API Gateway stages to your custom domain name |
| Latency Consideration | Utilize edge-optimized endpoints for latency-sensitive applications |
Additional Details
Security
- Renewals: ACM automatically renews certificates before their expiration date. Ensure that your DNS configuration supports ACM's renewal process.
- HTTPS Enforcement: Enforce HTTPS in your API Gateway settings to ensure secure connections.
Troubleshooting
- Common Errors: Misconfigured DNS records frequently result in connectivity issues. Double-check hostname patterns and certificate validation statuses.
- ACM Logs: Use AWS CloudTrail to trace actions performed with ACM for enhanced troubleshooting.
By following the outlined steps and considering technical specifics and configuration details, you'll be able to leverage AWS Certificate Manager capabilities effectively in your API Gateway deployment with a custom domain name.
Related reading
- Can I use boto3 anonymously?
- Can I use local SSDs on GKE for fast, temporary storage within a pod?
- Can I use PouchDB with Dynamo on the back instead of Couch?
- Can I write to an AWS MSK Kafka cluster from a Lambda function?
- Can I use Kafka queue in my Rest WEBSERVICE
- Can I write a program to see if a table exists in YugaByte's YCQL (Cassandra) api?
- Can Kubernetes be used like Docker Compose?
- Can the DynamoDB single table design play nicely with a Microservices architecture?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.