Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class CallAwsService extends sfn.TaskStateBase {
}

const iamServiceMap: Record<string, string> = {
bedrockagent: 'bedrock',
cloudwatchlogs: 'logs',
efs: 'elasticfilesystem',
elasticloadbalancingv2: 'elasticloadbalancing',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,38 @@ test('IAM policy for mediapackagevod', () => {
});
});

test('IAM policy for bedrockagent', () => {
// WHEN
const task = new tasks.CallAwsService(stack, 'StartIngestionJob', {
service: 'bedrockagent',
action: 'startIngestionJob',
parameters: {
DataSourceId: 'test-datasource-id',
KnowledgeBaseId: 'test-kb-id',
},
resultPath: sfn.JsonPath.DISCARD,
iamResources: ['*'],
});

new sfn.StateMachine(stack, 'StateMachine', {
definitionBody: sfn.DefinitionBody.fromChainable(task),
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
PolicyDocument: {
Statement: [
{
Action: 'bedrock:startIngestionJob',
Effect: 'Allow',
Resource: '*',
},
],
Version: '2012-10-17',
},
});
});

test('IAM policy for mwaa', () => {
// WHEN
const task = new tasks.CallAwsService(stack, 'ListMWAAEnvironments', {
Expand Down
Loading