0
0
AWScloud~10 mins

REST API creation in AWS - Interactive Code Practice

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

Complete the code to create a REST API Gateway resource named 'MyApi'.

AWS
aws apigateway create-rest-api --name [1]
Drag options to blanks, or click blank then click option'
AMyApi
BTestApi
CSampleApi
DDemoApi
Attempts:
3 left
💡 Hint
Common Mistakes
Using a name different from 'MyApi'.
Omitting the --name parameter.
2fill in blank
medium

Complete the code to create a resource under the REST API with the path part 'users'.

AWS
aws apigateway create-resource --rest-api-id [1] --parent-id abc123 --path-part users
Drag options to blanks, or click blank then click option'
Adef456
Babc123
Cghi012
Dxyz789
Attempts:
3 left
💡 Hint
Common Mistakes
Using the parent ID instead of the API ID.
Using an incorrect API ID.
3fill in blank
hard

Fix the error in the command to create a GET method for the 'users' resource.

AWS
aws apigateway put-method --rest-api-id def456 --resource-id [1] --http-method GET --authorization-type NONE
Drag options to blanks, or click blank then click option'
Aabc123
Bxyz789
Cdef456
Dghi012
Attempts:
3 left
💡 Hint
Common Mistakes
Using the REST API ID as the resource ID.
Using an unrelated resource ID.
4fill in blank
hard

Fill both blanks to integrate the GET method with a Lambda function named 'UserFunction'.

AWS
aws apigateway put-integration --rest-api-id def456 --resource-id xyz789 --http-method GET --type [1] --integration-http-method [2] --uri arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:123456789012:function:UserFunction/invocations
Drag options to blanks, or click blank then click option'
AAWS_PROXY
BPOST
CAWS
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'AWS_PROXY' instead of 'AWS' for integration type.
Using 'GET' instead of 'POST' for integration HTTP method.
5fill in blank
hard

Fill all three blanks to deploy the API to a stage named 'prod' in region 'us-east-1'.

AWS
aws --region [2] apigateway create-deployment --rest-api-id def456 --stage-name [1] --description [3]
Drag options to blanks, or click blank then click option'
Adev
Bprod
Cus-east-1
D"Production deployment"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'dev' instead of 'prod' for stage name.
Omitting quotes around the description.
Using wrong region.