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.