Skip to content

Commit

Permalink
Add converse APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
iann0036 committed Sep 10, 2024
1 parent ffc6d0b commit d2e2152
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
32 changes: 31 additions & 1 deletion aws/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -164316,12 +164316,42 @@
],
"VerifiedPermissions.BatchIsAuthorizedWithToken": [
{
"action": "verifiedpermissions:isauthorizedwithtoken",
"action": "verifiedpermissions:IsAuthorizedWithToken",
"undocumented": true,
"arn_override": {
"template": "arn:${Partition}:verifiedpermissions::767145733124:policy-store/${policyStoreId}"
}
}
],
"BedrockRuntime.Converse": [
{
"action": "bedrock:InvokeModel",
"resource_mappings": {
"ResourceId": {
"template": "*"
}
},
"resourcearn_mappings": {
"foundation-model": "%%iftemplatematch%${modelId}%%",
"imported-model": "%%iftemplatematch%${modelId}%%",
"provisioned-model": "%%iftemplatematch%${modelId}%%"
}
}
],
"BedrockRuntime.ConverseStream": [
{
"action": "bedrock:InvokeModelWithResponseStream",
"resource_mappings": {
"ResourceId": {
"template": "*"
}
},
"resourcearn_mappings": {
"foundation-model": "%%iftemplatematch%${modelId}%%",
"imported-model": "%%iftemplatematch%${modelId}%%",
"provisioned-model": "%%iftemplatematch%${modelId}%%"
}
}
]
},
"sdk_service_mappings": {
Expand Down
8 changes: 6 additions & 2 deletions util/aws_patch_iam_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
# Undocumented method tagging
for k, v in mapdata['sdk_method_iam_mappings'].items():
for mappingitem in v:
if 'undocumented' in mappingitem:
if 'undocumented' in mappingitem or mappingitem in ['BedrockRuntime.Converse', 'BedrockRuntime.ConverseStream']:
servicename = mappingitem['action'].split(":")[0]
methodname = mappingitem['action'].split(":")[1]

Expand All @@ -171,8 +171,12 @@
skip = True

if not skip:
accesslevel = "Unknown"
if mappingitem in ['BedrockRuntime.Converse', 'BedrockRuntime.ConverseStream']:
accesslevel = "Read"

iam_def[i]['privileges'].append({
"access_level": "Unknown",
"access_level": accesslevel,
"description": "",
"privilege": methodname,
"resource_types": [
Expand Down

0 comments on commit d2e2152

Please sign in to comment.