@@ -284,6 +284,17 @@ export class Bedrock extends PolicyStatement {
284
284
return this . to ( 'CreateInferenceProfile' ) ;
285
285
}
286
286
287
+ /**
288
+ * Grants permission to create a new invocation in an existing session
289
+ *
290
+ * Access Level: Write
291
+ *
292
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_CreateInvocation.html
293
+ */
294
+ public toCreateInvocation ( ) {
295
+ return this . to ( 'CreateInvocation' ) ;
296
+ }
297
+
287
298
/**
288
299
* Grants permission to create a knowledge base
289
300
*
@@ -428,6 +439,21 @@ export class Bedrock extends PolicyStatement {
428
439
return this . to ( 'CreateProvisionedModelThroughput' ) ;
429
440
}
430
441
442
+ /**
443
+ * Grants permission to create a new session
444
+ *
445
+ * Access Level: Write
446
+ *
447
+ * Possible conditions:
448
+ * - .ifAwsRequestTag()
449
+ * - .ifAwsTagKeys()
450
+ *
451
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_CreateSession.html
452
+ */
453
+ public toCreateSession ( ) {
454
+ return this . to ( 'CreateSession' ) ;
455
+ }
456
+
431
457
/**
432
458
* Grants permission to delete an Agent that you created earlier
433
459
*
@@ -690,6 +716,17 @@ export class Bedrock extends PolicyStatement {
690
716
return this . to ( 'DeleteResourcePolicy' ) ;
691
717
}
692
718
719
+ /**
720
+ * Grants permission to delete a Session that you created earlier
721
+ *
722
+ * Access Level: Write
723
+ *
724
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_DeleteSession.html
725
+ */
726
+ public toDeleteSession ( ) {
727
+ return this . to ( 'DeleteSession' ) ;
728
+ }
729
+
693
730
/**
694
731
* Grants permission to deregister a marketplace model endpoint to make it unusable in Bedrock Marketplace
695
732
*
@@ -732,6 +769,17 @@ export class Bedrock extends PolicyStatement {
732
769
return this . to ( 'DisassociateAgentKnowledgeBase' ) ;
733
770
}
734
771
772
+ /**
773
+ * Grants permission to end a Session that you created earlier
774
+ *
775
+ * Access Level: Write
776
+ *
777
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_EndSession.html
778
+ */
779
+ public toEndSession ( ) {
780
+ return this . to ( 'EndSession' ) ;
781
+ }
782
+
735
783
/**
736
784
* Grants permission to generate queries associated with user input
737
785
*
@@ -1007,6 +1055,17 @@ export class Bedrock extends PolicyStatement {
1007
1055
return this . to ( 'GetIngestionJob' ) ;
1008
1056
}
1009
1057
1058
+ /**
1059
+ * Grants permission to get an invocation step from a session
1060
+ *
1061
+ * Access Level: Read
1062
+ *
1063
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetInvocationStep.html
1064
+ */
1065
+ public toGetInvocationStep ( ) {
1066
+ return this . to ( 'GetInvocationStep' ) ;
1067
+ }
1068
+
1010
1069
/**
1011
1070
* Grants permission to retrieve an existing knowledge base
1012
1071
*
@@ -1148,6 +1207,17 @@ export class Bedrock extends PolicyStatement {
1148
1207
return this . to ( 'GetResourcePolicy' ) ;
1149
1208
}
1150
1209
1210
+ /**
1211
+ * Grants permission to retrieve an existing session
1212
+ *
1213
+ * Access Level: Read
1214
+ *
1215
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetSession.html
1216
+ */
1217
+ public toGetSession ( ) {
1218
+ return this . to ( 'GetSession' ) ;
1219
+ }
1220
+
1151
1221
/**
1152
1222
* Grants permission to retrieve a use case for model access
1153
1223
*
@@ -1499,6 +1569,28 @@ export class Bedrock extends PolicyStatement {
1499
1569
return this . to ( 'ListIngestionJobs' ) ;
1500
1570
}
1501
1571
1572
+ /**
1573
+ * Grants permission to get list of invocation step from a session
1574
+ *
1575
+ * Access Level: List
1576
+ *
1577
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListInvocationSteps.html
1578
+ */
1579
+ public toListInvocationSteps ( ) {
1580
+ return this . to ( 'ListInvocationSteps' ) ;
1581
+ }
1582
+
1583
+ /**
1584
+ * Grants permission to list invocations in a session
1585
+ *
1586
+ * Access Level: List
1587
+ *
1588
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListInvocations.html
1589
+ */
1590
+ public toListInvocations ( ) {
1591
+ return this . to ( 'ListInvocations' ) ;
1592
+ }
1593
+
1502
1594
/**
1503
1595
* Grants permission to list documents in a knowledge base
1504
1596
*
@@ -1618,6 +1710,17 @@ export class Bedrock extends PolicyStatement {
1618
1710
return this . to ( 'ListProvisionedModelThroughputs' ) ;
1619
1711
}
1620
1712
1713
+ /**
1714
+ * Grants permission to list existing sessions
1715
+ *
1716
+ * Access Level: List
1717
+ *
1718
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_ListSessions.html
1719
+ */
1720
+ public toListSessions ( ) {
1721
+ return this . to ( 'ListSessions' ) ;
1722
+ }
1723
+
1621
1724
/**
1622
1725
* Grants permission to list tags for a Bedrock resource
1623
1726
*
@@ -1673,6 +1776,17 @@ export class Bedrock extends PolicyStatement {
1673
1776
return this . to ( 'PutFoundationModelEntitlement' ) ;
1674
1777
}
1675
1778
1779
+ /**
1780
+ * Grants permission to put an invocation step into an invocation in session
1781
+ *
1782
+ * Access Level: Write
1783
+ *
1784
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_PutInvocationStep.html
1785
+ */
1786
+ public toPutInvocationStep ( ) {
1787
+ return this . to ( 'PutInvocationStep' ) ;
1788
+ }
1789
+
1676
1790
/**
1677
1791
* Grants permission to create an existing Invocation logging configuration
1678
1792
*
@@ -2010,6 +2124,17 @@ export class Bedrock extends PolicyStatement {
2010
2124
return this . to ( 'UpdateProvisionedModelThroughput' ) ;
2011
2125
}
2012
2126
2127
+ /**
2128
+ * Grants permission to update an existing session
2129
+ *
2130
+ * Access Level: Write
2131
+ *
2132
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_UpdateSession.html
2133
+ */
2134
+ public toUpdateSession ( ) {
2135
+ return this . to ( 'UpdateSession' ) ;
2136
+ }
2137
+
2013
2138
/**
2014
2139
* Grants permission to validate prompt flow definitions
2015
2140
*
@@ -2053,6 +2178,7 @@ export class Bedrock extends PolicyStatement {
2053
2178
'GetImportedModel' ,
2054
2179
'GetInferenceProfile' ,
2055
2180
'GetIngestionJob' ,
2181
+ 'GetInvocationStep' ,
2056
2182
'GetKnowledgeBase' ,
2057
2183
'GetKnowledgeBaseDocuments' ,
2058
2184
'GetMarketplaceModelEndpoint' ,
@@ -2066,6 +2192,7 @@ export class Bedrock extends PolicyStatement {
2066
2192
'GetPromptRouter' ,
2067
2193
'GetProvisionedModelThroughput' ,
2068
2194
'GetResourcePolicy' ,
2195
+ 'GetSession' ,
2069
2196
'GetUseCaseForModelAccess' ,
2070
2197
'InvokeAgent' ,
2071
2198
'InvokeFlow' ,
@@ -2099,6 +2226,7 @@ export class Bedrock extends PolicyStatement {
2099
2226
'CreateGuardrail' ,
2100
2227
'CreateGuardrailVersion' ,
2101
2228
'CreateInferenceProfile' ,
2229
+ 'CreateInvocation' ,
2102
2230
'CreateKnowledgeBase' ,
2103
2231
'CreateMarketplaceModelEndpoint' ,
2104
2232
'CreateModelCopyJob' ,
@@ -2109,6 +2237,7 @@ export class Bedrock extends PolicyStatement {
2109
2237
'CreatePrompt' ,
2110
2238
'CreatePromptVersion' ,
2111
2239
'CreateProvisionedModelThroughput' ,
2240
+ 'CreateSession' ,
2112
2241
'DeleteAgent' ,
2113
2242
'DeleteAgentActionGroup' ,
2114
2243
'DeleteAgentAlias' ,
@@ -2133,16 +2262,19 @@ export class Bedrock extends PolicyStatement {
2133
2262
'DeletePrompt' ,
2134
2263
'DeleteProvisionedModelThroughput' ,
2135
2264
'DeleteResourcePolicy' ,
2265
+ 'DeleteSession' ,
2136
2266
'DeregisterMarketplaceModelEndpoint' ,
2137
2267
'DisassociateAgentCollaborator' ,
2138
2268
'DisassociateAgentKnowledgeBase' ,
2269
+ 'EndSession' ,
2139
2270
'IngestKnowledgeBaseDocuments' ,
2140
2271
'InvokeBlueprintRecommendationAsync' ,
2141
2272
'InvokeBuilder' ,
2142
2273
'InvokeDataAutomationAsync' ,
2143
2274
'PrepareAgent' ,
2144
2275
'PrepareFlow' ,
2145
2276
'PutFoundationModelEntitlement' ,
2277
+ 'PutInvocationStep' ,
2146
2278
'PutModelInvocationLoggingConfiguration' ,
2147
2279
'PutResourcePolicy' ,
2148
2280
'PutUseCaseForModelAccess' ,
@@ -2168,7 +2300,8 @@ export class Bedrock extends PolicyStatement {
2168
2300
'UpdateKnowledgeBase' ,
2169
2301
'UpdateMarketplaceModelEndpoint' ,
2170
2302
'UpdatePrompt' ,
2171
- 'UpdateProvisionedModelThroughput'
2303
+ 'UpdateProvisionedModelThroughput' ,
2304
+ 'UpdateSession'
2172
2305
] ,
2173
2306
List : [
2174
2307
'ListAgentActionGroups' ,
@@ -2192,6 +2325,8 @@ export class Bedrock extends PolicyStatement {
2192
2325
'ListImportedModels' ,
2193
2326
'ListInferenceProfiles' ,
2194
2327
'ListIngestionJobs' ,
2328
+ 'ListInvocationSteps' ,
2329
+ 'ListInvocations' ,
2195
2330
'ListKnowledgeBaseDocuments' ,
2196
2331
'ListKnowledgeBases' ,
2197
2332
'ListModelCopyJobs' ,
@@ -2201,7 +2336,8 @@ export class Bedrock extends PolicyStatement {
2201
2336
'ListModelInvocationJobs' ,
2202
2337
'ListPromptRouters' ,
2203
2338
'ListPrompts' ,
2204
- 'ListProvisionedModelThroughputs'
2339
+ 'ListProvisionedModelThroughputs' ,
2340
+ 'ListSessions'
2205
2341
] ,
2206
2342
Tagging : [
2207
2343
'TagResource' ,
@@ -2631,6 +2767,23 @@ export class Bedrock extends PolicyStatement {
2631
2767
return this . on ( `arn:${ partition ?? this . defaultPartition } :bedrock:${ region ?? this . defaultRegion } :${ account ?? this . defaultAccount } :data-automation-invocation/${ jobId } ` ) ;
2632
2768
}
2633
2769
2770
+ /**
2771
+ * Adds a resource of type session to the statement
2772
+ *
2773
+ * https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html
2774
+ *
2775
+ * @param sessionId - Identifier for the sessionId.
2776
+ * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account.
2777
+ * @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region.
2778
+ * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition.
2779
+ *
2780
+ * Possible conditions:
2781
+ * - .ifAwsResourceTag()
2782
+ */
2783
+ public onSession ( sessionId : string , account ?: string , region ?: string , partition ?: string ) {
2784
+ return this . on ( `arn:${ partition ?? this . defaultPartition } :bedrock:${ region ?? this . defaultRegion } :${ account ?? this . defaultAccount } :session/${ sessionId } ` ) ;
2785
+ }
2786
+
2634
2787
/**
2635
2788
* Filters access by creating requests based on the allowed set of values for each of the mandatory tags
2636
2789
*
@@ -2654,6 +2807,7 @@ export class Bedrock extends PolicyStatement {
2654
2807
* - .toCreatePrompt()
2655
2808
* - .toCreatePromptVersion()
2656
2809
* - .toCreateProvisionedModelThroughput()
2810
+ * - .toCreateSession()
2657
2811
* - .toInvokeModel()
2658
2812
* - .toPutResourcePolicy()
2659
2813
* - .toTagResource()
@@ -2691,6 +2845,7 @@ export class Bedrock extends PolicyStatement {
2691
2845
* - prompt-version
2692
2846
* - model-import-job
2693
2847
* - imported-model
2848
+ * - session
2694
2849
*
2695
2850
* @param tagKey The tag key to check
2696
2851
* @param value The value(s) to check
@@ -2723,6 +2878,7 @@ export class Bedrock extends PolicyStatement {
2723
2878
* - .toCreatePrompt()
2724
2879
* - .toCreatePromptVersion()
2725
2880
* - .toCreateProvisionedModelThroughput()
2881
+ * - .toCreateSession()
2726
2882
* - .toInvokeModel()
2727
2883
* - .toPutResourcePolicy()
2728
2884
* - .toTagResource()
0 commit comments