API Gateway

API Gateway

Last modified on 2025-04-18 , by hjjae2

What is Amazon API Gateway? #

Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale.

API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud.

As an API Gateway API developer, you can create APIs for use in your own client applications. Or you can make your APIs available to third-party app developers.

Custom Domain Names #

API Gateway λŠ” 기본적으둜 μ•„λž˜ ν˜•νƒœμ™€ 같은 HOSTNAME 을 κ°–λŠ”λ‹€.

https://api-id.execute-api.region.amazonaws.com/stage

# https://ab123cdef4.execute-api.ap-northeast-2.amazonaws.com/my-stage/my-api-path

Custom Domain Names λ₯Ό μ‚¬μš©ν•  수 μžˆλ‹€.

λ¬Όλ‘  μ •μ‹μœΌλ‘œ λ“±λ‘λœ, μ†Œμœ ν•˜κ³  μžˆλŠ” domain 만 μ‚¬μš©ν•  수 μžˆλ‹€.

You must have a registered internet domain name in order to set up custom domain names for your APIs. If needed, you can register an internet domain using Amazon Route 53 or using a third-party domain registrar of your choice. An API’s custom domain name can be the name of a subdomain or the root domain (also known as “zone apex”) of a registered internet domain.

After a custom domain name is created in API Gateway, you must create or update your DNS provider’s resource record to map to your API endpoint. Without such a mapping, API requests bound for the custom domain name cannot reach API Gateway.

With custom domain names, you can set up your API’s hostname, and choose a base path (for example, myservice) to map the alternative URL to your API. For example, a more user-friendly API base URL can become: https://api.example.com/myservice

If you don’t set any base mapping under a custom domain name, the resulting API’s base URL is the same as the custom domain (for example, https://api.example.com). In this case, the custom domain name can’t support more than one API.

With AWS Lambda #

AWS Lambda Function을 ν˜ΈμΆœν•˜λŠ” ν˜•νƒœλ‘œ μ‚¬μš©ν•  μˆ˜λ„ μžˆλ‹€.

You can create a web API with an HTTP endpoint for your Lambda function by using Amazon API Gateway.

References #