AWS Certified Developer – Associate
Bedrock model access, API keys and invocation logging: DVA-C03
According to the Amazon Bedrock User Guide, most models are enabled on first use if the caller has AWS Marketplace permissions, and an IAM policy or SCP that denies bedrock:InvokeModel blocks inference. Short-term API keys are recommended for production. Model invocation logging is off by default and writes to CloudWatch Logs or Amazon S3.
Model access and how to deny it
In commercial Regions there is no access request to submit for most models. The first invocation of a third-party model starts an AWS Marketplace subscription in the background, which can take up to 15 minutes. That first caller needs aws-marketplace:Subscribe, aws-marketplace:Unsubscribe and aws-marketplace:ViewSubscriptions. Once the model is enabled for the account, callers no longer need Marketplace permissions.
Some Anthropic models also need first-time use case details, submitted once per account or once at the organization's management account, in the console or with PutUseCaseForModelAccess.
To block inference on a model, deny the actions that invoke it on that model's ARN. The same policy can be used as a service control policy across an organization. Denying bedrock:InvokeModel also blocks Converse and StartAsyncInvoke. To be explicit, use bedrock:InvokeModel* or add bedrock:Converse and bedrock:ConverseStream.
Short-term vs long-term Bedrock API keys
A Bedrock API key is a bearer token used instead of AWS credentials. Set it in AWS_BEARER_TOKEN_BEDROCK or send it in the Authorization header.
A short-term key lasts up to 12 hours or the length of the session, whichever is shorter, and inherits the permissions of the principal that generated it. AWS recommends it for production. A long-running application calls the token generator before each request and gets a cached token or a fresh one.
A long-term key lasts until a set expiration date, creates an IAM user, and is recommended only for exploration. If one leaks, deactivate it with UpdateServiceSpecificCredential and Status=Inactive, or reset or delete it. iam:CreateServiceSpecificCredential controls who can create long-term keys, and the iam:ServiceSpecificCredentialAgeDays condition key caps their lifetime. bedrock:CallWithBearerToken controls who can use a key.
Invocation logging and private connectivity
Model invocation logging captures the full request, response and metadata for Converse, ConverseStream, InvokeModel and InvokeModelWithResponseStream calls in an account and Region. It is disabled by default. Destinations are CloudWatch Logs and Amazon S3, and they must be in the same account and Region. JSON bodies up to 100 KB are logged inline. Larger bodies and binary data such as images go to S3.
An interface VPC endpoint gives private access with no internet gateway or NAT device. Each API family has its own service name: bedrock, bedrock-runtime, bedrock-agent and bedrock-agent-runtime. With private DNS enabled, code needs no change. The default endpoint policy allows full access, so attach a custom endpoint policy to limit actions or models.
Managing access to AI services, private connectivity with VPC endpoints and protecting log content are skills in Task 2.3 of the exam guide, a task that AWS lists as new in DVA-C03.
Where the exam catches people
- Believing long-term Bedrock API keys are the production choice: actually AWS recommends short-term keys for production and long-term keys only for exploration.
- Believing a deny on
bedrock:InvokeModelleaves the Converse API usable: actuallyConverseis blocked automatically whenInvokeModelis denied. - Believing model invocation logs can be delivered to a bucket in a central logging account: actually the destination must be in the same account and Region.
- Believing a new interface endpoint limits which models can be called: actually its default policy allows full access until you attach a custom one.
- Believing every role that invokes a third-party model needs Marketplace permissions: actually only the caller that first enables the model for the account does.