0
0
Microservicessystem_design~10 mins

Popular gateways (Kong, AWS API Gateway, Nginx) in Microservices - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the default port for Nginx gateway.

Microservices
server {
    listen [1];
    server_name localhost;
}
Drag options to blanks, or click blank then click option'
A8080
B80
C443
D3000
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 443 which is for HTTPS.
Using arbitrary ports like 3000 or 8080 without configuration.
2fill in blank
medium

Complete the code to define an AWS API Gateway REST API resource path.

Microservices
Resources:
  MyResource:
    Type: AWS::ApiGateway::Resource
    Properties:
      [1]: /myresource
Drag options to blanks, or click blank then click option'
AStageName
BEndpointConfiguration
CResourcePath
DPathPart
Attempts:
3 left
💡 Hint
Common Mistakes
Using StageName which defines deployment stage.
Using EndpointConfiguration which defines endpoint types.
3fill in blank
hard

Fix the error in the Kong configuration snippet to enable proxying to the upstream service.

Microservices
services:
  - name: example-service
    url: http://[1]:8080
    routes:
      - name: example-route
        paths:
          - /example
Drag options to blanks, or click blank then click option'
Aexample.com
B127.0.0.1
Clocalhost
Dupstream
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'example.com' which may not resolve to the local service.
Using 'upstream' which is not a valid hostname.
4fill in blank
hard

Fill both blanks to configure Nginx to proxy requests to a backend service on port 5000.

Microservices
location /api/ {
    proxy_pass http://[1]:[2];
}
Drag options to blanks, or click blank then click option'
Alocalhost
B5000
C8080
D127.0.0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong port like 8080.
Using IP 127.0.0.1 instead of localhost (both work but question expects localhost).
5fill in blank
hard

Fill all three blanks to define an AWS API Gateway method with HTTP GET integration to a Lambda function.

Microservices
Resources:
  MyMethod:
    Type: AWS::ApiGateway::Method
    Properties:
      HttpMethod: [1]
      ResourceId: !Ref MyResource
      Integration:
        Type: [2]
        IntegrationHttpMethod: [3]
Drag options to blanks, or click blank then click option'
AGET
BAWS_PROXY
CPOST
DPUT
Attempts:
3 left
💡 Hint
Common Mistakes
Using PUT or GET as integration HTTP method instead of POST.
Using wrong integration type.