Open ryihan opened 2 years ago
For an app to call publicly available AWS services, you can use Lambda to interact with required services and expose Lambda functions through API methods in API Gateway. AWS Lambda runs your code on a highly available computing infrastructure. It performs the necessary execution and administration of computing resources. To enable serverless applications, API Gateway supports streamlined proxy integrations with AWS Lambda and HTTP endpoints.
--domain-name api.example.com \
--api-mapping-key v1/orders \
--api-id a1b2c3d4 \
--stage test```
#The following AWS CloudFormation example creates an API mapping.
```MyApiMapping:
Type: 'AWS::ApiGatewayV2::ApiMapping'
Properties:
DomainName: api.example.com.com
ApiMappingKey: 'orders/v2/items'
ApiId: !Ref MyApi
Stage: !Ref MyStage```
Disabling the default endpoint for an HTTP API
aws apigatewayv2 update-api \ --api-id abcdef123 \ --disable-execute-api-endpoint
aws apigatewayv2 create-deployment \ --api-id abcdef123 \ --stage-name dev
The following AWS CLI command creates a deployment
--api-id abcdef123 \
--stage-name dev```
Together with AWS Lambda, API Gateway forms the app-facing part of the AWS serverless infrastructure.