Skip to content

Commit dcdcd23

Browse files
authored
Merge pull request #1172 from udondan/iam-updates
2 parents e019e97 + 1dd89cc commit dcdcd23

File tree

13 files changed

+228
-9
lines changed

13 files changed

+228
-9
lines changed

Diff for: CHANGELOG/v0.677.0.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
**New actions:**
2+
3+
- application-signals:Link
4+
- bedrock:CreateInvocation
5+
- bedrock:CreateSession
6+
- bedrock:DeleteSession
7+
- bedrock:EndSession
8+
- bedrock:GetInvocationStep
9+
- bedrock:GetSession
10+
- bedrock:ListInvocationSteps
11+
- bedrock:ListInvocations
12+
- bedrock:ListSessions
13+
- bedrock:PutInvocationStep
14+
- bedrock:UpdateSession
15+
- ses:PutConfigurationSetArchivingOptions
16+
17+
**New resource types:**
18+
19+
- bedrock:session

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
Support for:
1818

1919
- 416 Services
20-
- 18285 Actions
21-
- 1963 Resource Types
20+
- 18298 Actions
21+
- 1964 Resource Types
2222
- 1919 Condition keys
2323
<!-- /stats -->
2424

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.676.0
1+
0.677.0

Diff for: docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = 'Daniel Schroeder'
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = '0.676.0'
27+
release = '0.677.0'
2828

2929
# -- General configuration ---------------------------------------------------
3030

Diff for: docs/source/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ AWS IAM policy statement generator with fluent interface.
3131
Support for:
3232

3333
- 416 Services
34-
- 18285 Actions
35-
- 1963 Resource Types
34+
- 18298 Actions
35+
- 1964 Resource Types
3636
- 1919 Condition keys
3737

3838
..

Diff for: lib/generated/policy-statements/bedrock.ts

+158-2
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,17 @@ export class Bedrock extends PolicyStatement {
284284
return this.to('CreateInferenceProfile');
285285
}
286286

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+
287298
/**
288299
* Grants permission to create a knowledge base
289300
*
@@ -428,6 +439,21 @@ export class Bedrock extends PolicyStatement {
428439
return this.to('CreateProvisionedModelThroughput');
429440
}
430441

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+
431457
/**
432458
* Grants permission to delete an Agent that you created earlier
433459
*
@@ -690,6 +716,17 @@ export class Bedrock extends PolicyStatement {
690716
return this.to('DeleteResourcePolicy');
691717
}
692718

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+
693730
/**
694731
* Grants permission to deregister a marketplace model endpoint to make it unusable in Bedrock Marketplace
695732
*
@@ -732,6 +769,17 @@ export class Bedrock extends PolicyStatement {
732769
return this.to('DisassociateAgentKnowledgeBase');
733770
}
734771

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+
735783
/**
736784
* Grants permission to generate queries associated with user input
737785
*
@@ -1007,6 +1055,17 @@ export class Bedrock extends PolicyStatement {
10071055
return this.to('GetIngestionJob');
10081056
}
10091057

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+
10101069
/**
10111070
* Grants permission to retrieve an existing knowledge base
10121071
*
@@ -1148,6 +1207,17 @@ export class Bedrock extends PolicyStatement {
11481207
return this.to('GetResourcePolicy');
11491208
}
11501209

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+
11511221
/**
11521222
* Grants permission to retrieve a use case for model access
11531223
*
@@ -1499,6 +1569,28 @@ export class Bedrock extends PolicyStatement {
14991569
return this.to('ListIngestionJobs');
15001570
}
15011571

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+
15021594
/**
15031595
* Grants permission to list documents in a knowledge base
15041596
*
@@ -1618,6 +1710,17 @@ export class Bedrock extends PolicyStatement {
16181710
return this.to('ListProvisionedModelThroughputs');
16191711
}
16201712

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+
16211724
/**
16221725
* Grants permission to list tags for a Bedrock resource
16231726
*
@@ -1673,6 +1776,17 @@ export class Bedrock extends PolicyStatement {
16731776
return this.to('PutFoundationModelEntitlement');
16741777
}
16751778

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+
16761790
/**
16771791
* Grants permission to create an existing Invocation logging configuration
16781792
*
@@ -2010,6 +2124,17 @@ export class Bedrock extends PolicyStatement {
20102124
return this.to('UpdateProvisionedModelThroughput');
20112125
}
20122126

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+
20132138
/**
20142139
* Grants permission to validate prompt flow definitions
20152140
*
@@ -2053,6 +2178,7 @@ export class Bedrock extends PolicyStatement {
20532178
'GetImportedModel',
20542179
'GetInferenceProfile',
20552180
'GetIngestionJob',
2181+
'GetInvocationStep',
20562182
'GetKnowledgeBase',
20572183
'GetKnowledgeBaseDocuments',
20582184
'GetMarketplaceModelEndpoint',
@@ -2066,6 +2192,7 @@ export class Bedrock extends PolicyStatement {
20662192
'GetPromptRouter',
20672193
'GetProvisionedModelThroughput',
20682194
'GetResourcePolicy',
2195+
'GetSession',
20692196
'GetUseCaseForModelAccess',
20702197
'InvokeAgent',
20712198
'InvokeFlow',
@@ -2099,6 +2226,7 @@ export class Bedrock extends PolicyStatement {
20992226
'CreateGuardrail',
21002227
'CreateGuardrailVersion',
21012228
'CreateInferenceProfile',
2229+
'CreateInvocation',
21022230
'CreateKnowledgeBase',
21032231
'CreateMarketplaceModelEndpoint',
21042232
'CreateModelCopyJob',
@@ -2109,6 +2237,7 @@ export class Bedrock extends PolicyStatement {
21092237
'CreatePrompt',
21102238
'CreatePromptVersion',
21112239
'CreateProvisionedModelThroughput',
2240+
'CreateSession',
21122241
'DeleteAgent',
21132242
'DeleteAgentActionGroup',
21142243
'DeleteAgentAlias',
@@ -2133,16 +2262,19 @@ export class Bedrock extends PolicyStatement {
21332262
'DeletePrompt',
21342263
'DeleteProvisionedModelThroughput',
21352264
'DeleteResourcePolicy',
2265+
'DeleteSession',
21362266
'DeregisterMarketplaceModelEndpoint',
21372267
'DisassociateAgentCollaborator',
21382268
'DisassociateAgentKnowledgeBase',
2269+
'EndSession',
21392270
'IngestKnowledgeBaseDocuments',
21402271
'InvokeBlueprintRecommendationAsync',
21412272
'InvokeBuilder',
21422273
'InvokeDataAutomationAsync',
21432274
'PrepareAgent',
21442275
'PrepareFlow',
21452276
'PutFoundationModelEntitlement',
2277+
'PutInvocationStep',
21462278
'PutModelInvocationLoggingConfiguration',
21472279
'PutResourcePolicy',
21482280
'PutUseCaseForModelAccess',
@@ -2168,7 +2300,8 @@ export class Bedrock extends PolicyStatement {
21682300
'UpdateKnowledgeBase',
21692301
'UpdateMarketplaceModelEndpoint',
21702302
'UpdatePrompt',
2171-
'UpdateProvisionedModelThroughput'
2303+
'UpdateProvisionedModelThroughput',
2304+
'UpdateSession'
21722305
],
21732306
List: [
21742307
'ListAgentActionGroups',
@@ -2192,6 +2325,8 @@ export class Bedrock extends PolicyStatement {
21922325
'ListImportedModels',
21932326
'ListInferenceProfiles',
21942327
'ListIngestionJobs',
2328+
'ListInvocationSteps',
2329+
'ListInvocations',
21952330
'ListKnowledgeBaseDocuments',
21962331
'ListKnowledgeBases',
21972332
'ListModelCopyJobs',
@@ -2201,7 +2336,8 @@ export class Bedrock extends PolicyStatement {
22012336
'ListModelInvocationJobs',
22022337
'ListPromptRouters',
22032338
'ListPrompts',
2204-
'ListProvisionedModelThroughputs'
2339+
'ListProvisionedModelThroughputs',
2340+
'ListSessions'
22052341
],
22062342
Tagging: [
22072343
'TagResource',
@@ -2631,6 +2767,23 @@ export class Bedrock extends PolicyStatement {
26312767
return this.on(`arn:${ partition ?? this.defaultPartition }:bedrock:${ region ?? this.defaultRegion }:${ account ?? this.defaultAccount }:data-automation-invocation/${ jobId }`);
26322768
}
26332769

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+
26342787
/**
26352788
* Filters access by creating requests based on the allowed set of values for each of the mandatory tags
26362789
*
@@ -2654,6 +2807,7 @@ export class Bedrock extends PolicyStatement {
26542807
* - .toCreatePrompt()
26552808
* - .toCreatePromptVersion()
26562809
* - .toCreateProvisionedModelThroughput()
2810+
* - .toCreateSession()
26572811
* - .toInvokeModel()
26582812
* - .toPutResourcePolicy()
26592813
* - .toTagResource()
@@ -2691,6 +2845,7 @@ export class Bedrock extends PolicyStatement {
26912845
* - prompt-version
26922846
* - model-import-job
26932847
* - imported-model
2848+
* - session
26942849
*
26952850
* @param tagKey The tag key to check
26962851
* @param value The value(s) to check
@@ -2723,6 +2878,7 @@ export class Bedrock extends PolicyStatement {
27232878
* - .toCreatePrompt()
27242879
* - .toCreatePromptVersion()
27252880
* - .toCreateProvisionedModelThroughput()
2881+
* - .toCreateSession()
27262882
* - .toInvokeModel()
27272883
* - .toPutResourcePolicy()
27282884
* - .toTagResource()

0 commit comments

Comments
 (0)