exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 36 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 36
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company maintains a REST service using Amazon API Gateway and the API Gateway native API key validation. The company recently launched a new registration page, which allows users to sign up for the service. The registration page creates a new API key using CreateApiKey and sends the new key to the user. When the user attempts to call the API using this key, the user receives a 403 Forbidden error. Existing users are unaffected and can still call the API.
What code updates will grant these new users access to the API?

  • A. The createDeployment method must be called so the API can be redeployed to include the newly created API key.
  • B. The updateAuthorizer method must be called to update the API's authorizer to include the newly created API key.
  • C. The importApiKeys method must be called to import all newly created API keys into the current stage of the API.
  • D. The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
paosid
Highly Voted 3 years, 7 months ago
D: Do you have a Usage Plan? if not need to create one. Link you API with Usage Plan. For that add a stage, it will link your API. Do you have API Key? if not you need to create an API Key and enable it. Add the Usage Plan which is linked with your API to this API Key. For that add Usage Plan.
upvoted 25 times
paosid
3 years, 7 months ago
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-key-source.html
upvoted 3 times
...
...
Dev1
Highly Voted 3 years, 6 months ago
Ans: D https://stackoverflow.com/questions/39061041/using-an-api-key-in-amazon-api-gateway
upvoted 10 times
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: D
A) Eliminated - Redeployment is only needed if you've made changes to the API configuration or code itself (like adding new endpoints, changing logic, etc.). In this case, the issue is not with the API's deployment or its functionality. The registration page and the API key creation process are already working (users are signing up and receiving keys).
upvoted 1 times
sumanshu
4 months, 1 week ago
B) Eliminated - API is using API Gateway native API key validation, there’s no custom authorizer involved here. So, updating or modifying the authorizer is irrelevant in this context.
upvoted 1 times
sumanshu
4 months, 1 week ago
C) Eliminated - In this scenario, the keys are being created programmatically using the CreateApiKey method, so there’s no need to import keys—they are already in API Gateway.
upvoted 1 times
...
...
...
rcaliandro
1 year, 10 months ago
Selected Answer: D
D is the correct one. "The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan"
upvoted 1 times
...
dp8719823
2 years, 1 month ago
Selected Answer: D
To grant access to the API for newly registered users, the developer needs to associate the newly created API key with the API usage plan. To do this, the createUsagePlanKey method should be called to add the API key to the correct usage plan. By default, API Gateway only grants access to API keys that are associated with a usage plan, and new API keys are not automatically associated with a usage plan. The usage plan specifies the throttling and quota limits for the API. Once the API key is added to the usage plan, the user should be able to access the API.
upvoted 3 times
...
GARGMOH
2 years, 1 month ago
Selected Answer: D
Answer is D.
upvoted 1 times
...
Dominicwild12
2 years, 2 months ago
Selected Answer: D
The most likely issue is that the new API key has not been associated with an appropriate usage plan. The usage plan specifies the API stages and throttling limits that apply to the API key. The 403 Forbidden error is returned when an API key is not associated with a usage plan that allows access to the requested API method. To grant access to the new users, the createUsagePlanKey method should be called to associate the newly created API key with the appropriate usage plan. The usage plan must exist before the API key can be associated with it. Therefore, option D is the correct answer.
upvoted 2 times
...
ayoubmk
2 years, 3 months ago
Selected Answer: D
DDDDDD
upvoted 1 times
...
speer
2 years, 4 months ago
Selected Answer: D
Correct is D
upvoted 1 times
...
SM1997
3 years ago
Selected Answer: D
Answer - D
upvoted 1 times
...
Vlasto
3 years, 2 months ago
Selected Answer: D
Import and create are either or operations according to this: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-setup-api-key-with-restapi.html So you either create or import, not both, so I agree with D.
upvoted 1 times
...
praveenas400
3 years, 5 months ago
Answer is D: 403 - Forbidden – The request is not allowed or the instance metadata service is turned off. When you associate a usage plan with an API and enable API keys on API methods, every incoming request to the API must contain an API key. API Gateway reads the key and compares it against the keys in the usage plan. If there is a match, API Gateway throttles the requests according to the plan's request limit and quota. Otherwise, it throws an InvalidKeyParameter exception. As a result, the caller receives a 403 Forbidden response.
upvoted 6 times
...
sanju87
3 years, 5 months ago
ApiKey is already created and available, no need of ImportApiKey (It's either CreateApiKey or ImportApiKey) So, CreateUsagePlan will link the ApiKey to API and give users access. Answer :D https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html
upvoted 2 times
...
VAG1595
3 years, 5 months ago
Answer: D
upvoted 1 times
...
wils3
3 years, 5 months ago
Ans : D
upvoted 1 times
...
krasimir123
3 years, 6 months ago
Correct answer is D ! A usage plan specifies who can access one or more deployed API stages and methods—and also how much and how fast they can access them. The plan uses API keys to identify API clients and meters access to the associated API stages for each key. It also lets you configure throttling limits and quota limits that are enforced on individual client API keys.
upvoted 2 times
...
Mallesh21
3 years, 6 months ago
C,D are correct but I think C should be first priority . https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-setup-api-key-with-console.html
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago