A production service calls Amazon Bedrock with an API key. Which kind of Bedrock API key does AWS recommend for production use?
- Exam domain
- Operating, Monitoring, and Securing ML and AI Solutions24% of the exam
- Difficulty
- Hard
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task 4.3: Secure ML and AI workloads and model endpoints.
Objective in the exam guide: Skill 4.3.8: Select the appropriate credential type to access FMs (for example, Amazon Bedrock API keys, IAM credentials).
Long-lived credentials are a top cause of cloud breaches. Choosing the right credential type for model access is a direct security decision.
Why B is the answer
A short-term API key, which lasts up to 12 hours and inherits the permissions of the IAM identity that created it
The Bedrock documentation recommends short-term API keys for production and long-term keys only for exploration.
Remember: Bedrock API keys: short-term for production, long-term only for exploration.
How it works
Amazon Bedrock supports API keys in addition to IAM credentials.
Short-term keys last up to 12 hours and inherit the permissions of the IAM principal that generated them; AWS recommends them for production.
Long-term keys last until a set expiry and create an IAM user; AWS recommends them only for exploration.
Clues in the question
The words that point to the answer, and what each one tells you.
- Production service
- Follow the production recommendation.
In detail
- IAM credentials, such as roles, remain the standard for AWS workloads.
- API calls are logged in CloudTrail; the keys themselves are not logged.
Side by side with look-alikes
| Credential | Recommended for |
|---|---|
| Short-term Bedrock API key | Production |
| Long-term Bedrock API key | Exploration only |
| IAM role credentials | AWS workloads generally |
| Root keys | Never |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. The root user's access keysWrong
Root keys should never be used for workloads.
B. A short-term API key, which lasts up to 12 hours and inherits the permissions of the IAM identity that created itRight
Bedrock API keys: short-term for production, long-term only for exploration.
C. A long-term API key with no expiryWrongMost tempting
Long-term keys are recommended only for exploration.
Why it tempts: It never needs refreshing, which is convenient. But the documentation recommends long-term keys only for exploration.
D. A shared key pasted into the source codeWrong
Keys in source code leak.
In practice
- Refresh short-term keys automatically.
- Prefer IAM roles where the client supports them.
Use case
An illustrative scenario, not a real incident.
A service refreshes a short-term Bedrock API key automatically instead of storing a long-lived one.
See how it works
flowchart TD
U{"What is the use?"} -->|"Production service"| S["Short-term API key or IAM role"]
U -->|"Quick exploration"| L["Long-term API key, with expiry"]How to read this chart
- At "What is the use?": if "Production service", go to "Short-term API key or IAM role"; if "Quick exploration", go to "Long-term API key, with expiry".