Skip to content

Instantly share code, notes, and snippets.

@ensean
Created December 8, 2025 02:14
Show Gist options
  • Select an option

  • Save ensean/9c9b2f6df2bf9d85cefb80a34ff711c7 to your computer and use it in GitHub Desktop.

Select an option

Save ensean/9c9b2f6df2bf9d85cefb80a34ff711c7 to your computer and use it in GitHub Desktop.
IAM min policy for specific 3rd party model usage
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAnthropicAndAmazonModelsOnly",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:*::inference-profile/us.anthropic.claude-haiku-4-5-20251001-v1:0",
"arn:aws:bedrock:*::foundation-model/anthropic.claude-haiku-4-5-20251001-v1:0",
"arn:aws:bedrock:*::inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0",
"arn:aws:bedrock:*::foundation-model/anthropic.claude-3-7-sonnet-20250219-v1:0",
"arn:aws:bedrock:*::inference-profile/us.anthropic.claude-sonnet-4-20250514-v1:0",
"arn:aws:bedrock:*::foundation-model/anthropic.claude-sonnet-4-20250514-v1:0"
]
},
{
"Sid": "AllowOnlySpecificMarketplaceSubscription",
"Effect": "Allow",
"Action": [
"aws-marketplace:ViewSubscriptions",
"aws-marketplace:Subscribe"
],
"Resource": "*",
"Condition": {
"ForAllValues:StringEquals": {
"aws-marketplace:ProductId": [
"prod-4pmewlybdftbs",
"prod-xdkflymybwmvi",
"prod-4dlfvry4v5hbi"
]
},
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment