Skip to content

Commit ab083c5

Browse files
Sugi275sugusugiaws
andauthored
Model のアクセス変更に伴い、Marketplace に関する権限を追加。これによって、自動的にモデルを利用可能となる (#1336)
Co-authored-by: sugusugi <sugusugi@amazon.co.jp>
1 parent 3d699dc commit ab083c5

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

packages/cdk/lib/construct/api.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,13 @@ export class Api extends Construct {
530530
const bedrockPolicy = new PolicyStatement({
531531
effect: Effect.ALLOW,
532532
resources: ['*'],
533-
actions: ['bedrock:*', 'logs:*'],
533+
actions: [
534+
'bedrock:*',
535+
'logs:*',
536+
'aws-marketplace:Subscribe',
537+
'aws-marketplace:Unsubscribe',
538+
'aws-marketplace:ViewSubscriptions',
539+
],
534540
});
535541
predictStreamFunction.role?.addToPrincipalPolicy(bedrockPolicy);
536542
predictFunction.role?.addToPrincipalPolicy(bedrockPolicy);

packages/cdk/test/__snapshots__/generative-ai-use-cases.test.ts.snap

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15257,6 +15257,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1525715257
"Action": [
1525815258
"bedrock:*",
1525915259
"logs:*",
15260+
"aws-marketplace:Subscribe",
15261+
"aws-marketplace:Unsubscribe",
15262+
"aws-marketplace:ViewSubscriptions",
1526015263
],
1526115264
"Effect": "Allow",
1526215265
"Resource": "*",
@@ -15492,6 +15495,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1549215495
"Action": [
1549315496
"bedrock:*",
1549415497
"logs:*",
15498+
"aws-marketplace:Subscribe",
15499+
"aws-marketplace:Unsubscribe",
15500+
"aws-marketplace:ViewSubscriptions",
1549515501
],
1549615502
"Effect": "Allow",
1549715503
"Resource": "*",
@@ -16404,6 +16410,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1640416410
"Action": [
1640516411
"bedrock:*",
1640616412
"logs:*",
16413+
"aws-marketplace:Subscribe",
16414+
"aws-marketplace:Unsubscribe",
16415+
"aws-marketplace:ViewSubscriptions",
1640716416
],
1640816417
"Effect": "Allow",
1640916418
"Resource": "*",
@@ -17089,6 +17098,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1708917098
"Action": [
1709017099
"bedrock:*",
1709117100
"logs:*",
17101+
"aws-marketplace:Subscribe",
17102+
"aws-marketplace:Unsubscribe",
17103+
"aws-marketplace:ViewSubscriptions",
1709217104
],
1709317105
"Effect": "Allow",
1709417106
"Resource": "*",
@@ -17207,6 +17219,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1720717219
"Action": [
1720817220
"bedrock:*",
1720917221
"logs:*",
17222+
"aws-marketplace:Subscribe",
17223+
"aws-marketplace:Unsubscribe",
17224+
"aws-marketplace:ViewSubscriptions",
1721017225
],
1721117226
"Effect": "Allow",
1721217227
"Resource": "*",
@@ -17366,6 +17381,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1736617381
"Action": [
1736717382
"bedrock:*",
1736817383
"logs:*",
17384+
"aws-marketplace:Subscribe",
17385+
"aws-marketplace:Unsubscribe",
17386+
"aws-marketplace:ViewSubscriptions",
1736917387
],
1737017388
"Effect": "Allow",
1737117389
"Resource": "*",
@@ -17621,6 +17639,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1762117639
"Action": [
1762217640
"bedrock:*",
1762317641
"logs:*",
17642+
"aws-marketplace:Subscribe",
17643+
"aws-marketplace:Unsubscribe",
17644+
"aws-marketplace:ViewSubscriptions",
1762417645
],
1762517646
"Effect": "Allow",
1762617647
"Resource": "*",
@@ -17815,6 +17836,9 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = `
1781517836
"Action": [
1781617837
"bedrock:*",
1781717838
"logs:*",
17839+
"aws-marketplace:Subscribe",
17840+
"aws-marketplace:Unsubscribe",
17841+
"aws-marketplace:ViewSubscriptions",
1781817842
],
1781917843
"Effect": "Allow",
1782017844
"Resource": "*",
@@ -36078,6 +36102,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3607836102
"Action": [
3607936103
"bedrock:*",
3608036104
"logs:*",
36105+
"aws-marketplace:Subscribe",
36106+
"aws-marketplace:Unsubscribe",
36107+
"aws-marketplace:ViewSubscriptions",
3608136108
],
3608236109
"Effect": "Allow",
3608336110
"Resource": "*",
@@ -36283,6 +36310,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3628336310
"Action": [
3628436311
"bedrock:*",
3628536312
"logs:*",
36313+
"aws-marketplace:Subscribe",
36314+
"aws-marketplace:Unsubscribe",
36315+
"aws-marketplace:ViewSubscriptions",
3628636316
],
3628736317
"Effect": "Allow",
3628836318
"Resource": "*",
@@ -37015,6 +37045,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3701537045
"Action": [
3701637046
"bedrock:*",
3701737047
"logs:*",
37048+
"aws-marketplace:Subscribe",
37049+
"aws-marketplace:Unsubscribe",
37050+
"aws-marketplace:ViewSubscriptions",
3701837051
],
3701937052
"Effect": "Allow",
3702037053
"Resource": "*",
@@ -37580,6 +37613,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3758037613
"Action": [
3758137614
"bedrock:*",
3758237615
"logs:*",
37616+
"aws-marketplace:Subscribe",
37617+
"aws-marketplace:Unsubscribe",
37618+
"aws-marketplace:ViewSubscriptions",
3758337619
],
3758437620
"Effect": "Allow",
3758537621
"Resource": "*",
@@ -37668,6 +37704,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3766837704
"Action": [
3766937705
"bedrock:*",
3767037706
"logs:*",
37707+
"aws-marketplace:Subscribe",
37708+
"aws-marketplace:Unsubscribe",
37709+
"aws-marketplace:ViewSubscriptions",
3767137710
],
3767237711
"Effect": "Allow",
3767337712
"Resource": "*",
@@ -37797,6 +37836,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3779737836
"Action": [
3779837837
"bedrock:*",
3779937838
"logs:*",
37839+
"aws-marketplace:Subscribe",
37840+
"aws-marketplace:Unsubscribe",
37841+
"aws-marketplace:ViewSubscriptions",
3780037842
],
3780137843
"Effect": "Allow",
3780237844
"Resource": "*",
@@ -38003,6 +38045,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3800338045
"Action": [
3800438046
"bedrock:*",
3800538047
"logs:*",
38048+
"aws-marketplace:Subscribe",
38049+
"aws-marketplace:Unsubscribe",
38050+
"aws-marketplace:ViewSubscriptions",
3800638051
],
3800738052
"Effect": "Allow",
3800838053
"Resource": "*",
@@ -38167,6 +38212,9 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = `
3816738212
"Action": [
3816838213
"bedrock:*",
3816938214
"logs:*",
38215+
"aws-marketplace:Subscribe",
38216+
"aws-marketplace:Unsubscribe",
38217+
"aws-marketplace:ViewSubscriptions",
3817038218
],
3817138219
"Effect": "Allow",
3817238220
"Resource": "*",

0 commit comments

Comments
 (0)