- Newest
- Most votes
- Most comments
To maintain security without triggering the "invalid configuration" error, make two specific changes:
-
Specify the Region: Replace the * with the actual region where you are running the jobs (e.g., us-east-1).
-
Use ArnLike for Wildcards: If you must use wildcards (for the region or the job ID), you should use the ArnLike condition operator instead of ArnEquals.
Updated Trust Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "bedrock.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:SourceAccount": "123456789012"
},
"ArnLike": {
"aws:SourceArn": "arn:aws:bedrock:us-east-1:123456789012:model-invocation-job/*"
}
}
}
]
}
My understanding, why it stoped working?
AWS services occasionally update their "Confused Deputy" prevention logic. While ArnEquals with a wildcard might have been overlooked previously, standard IAM best practice dictates that ArnEquals is for exact matches and ArnLike is for pattern matching.
Security Note: Keeping aws:SourceAccount is correct and necessary. By switching to ArnLike and a specific region, you resolve the validation error while keeping the cross-account protection fully intact.
This appears to be a condition key propagation issue specific to VPC endpoint routing.
What's happening
When Bedrock Batch runs with VPC configuration, the sts:AssumeRole call is routed through the VPC endpoint. In this path, the aws:SourceArn condition context key is either not populated or arrives with a different value — causing the condition check to fail. This explains why removing the condition entirely, or running without VPC, works fine.
Ref: IAM condition context keys reference
Workaround that maintains cross-account protection
Remove aws:SourceArn but keep aws:SourceAccount:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "bedrock.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "123456789012" } } } ] }
This protects against the confused deputy cross-account attack vector. You lose job-level ARN scoping temporarily, but the account-level guard remains intact.
Recommended next step
Open an AWS Support case under "Account and billing" (free) and reference this thread. A working configuration breaking with no changes on your side, specifically tied to VPC batch config, is a regression worth reporting.
This workaround didn't work either. I tried multiple conditions for
aws:SourceAccountandaws:SourceArnwithStringEquals,StringLike,ArnEqualsandArnLike, but none of these work when VPC config is enabled. These included that exact version too.
Relevant content
- asked 8 months ago
- asked a year ago
- AWS OFFICIALUpdated a year ago

This didn't help. I've tried quite many combinations and only working change to policy is to remove condition completely.
I dug this bit deeper and noticed that this is related to VPC configuration. I'm running batch execution with VPC config (https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc.html) and this seem to make a difference:
And when I said that couple days ago this just stopped working means that I didn't do any code or configuration changes. Automated jobs just started to fail indicating something was changed by AWS (somewhere around Wed/Thu this week). Bit frustrating as I can't find any information about changes related to VPC, VPC endpoints or Bedrock execution!
I'm also using VPC endpoints within the VPC (for
bedrock-runtimeandbedrockservices), but don't know if that has anything to do with this (at least it shouldn't). Not sure if this is such a rare scenario that this has been on-going for multiple days without any fixes or health notifications.