-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IT-3988: Add role to invoke model and move inline sso policy to manag…
…ed policy (#1277) * Add role * Move policy from inline to managed * Rename stack/policy * Fix per review * Rename stack * Restore inline policy per review * Create agent role in all accounts per review * Rename output per review
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
org-formation/300-account-defaults/bedrock-agent-role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: Enables executing a Bedrock model | ||
|
||
Resources: | ||
# https://docs.aws.amazon.com/bedrock/latest/userguide/agents-permissions.html | ||
bedrockAgentRole: | ||
Type: AWS::IAM::Role | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: 2012-10-17 | ||
Statement: | ||
- Effect: Allow | ||
Principal: | ||
Service: bedrock.amazonaws.com | ||
Action: sts:AssumeRole | ||
Condition: | ||
StringEquals: | ||
aws:SourceAccount: !Ref AWS::AccountId | ||
ArnLike: | ||
aws:SourceArn: !Sub "arn:aws:bedrock:${AWS::Region}:${AWS::AccountId}:agent/*" | ||
Policies: | ||
- PolicyName: bedrockAgentPolicy | ||
PolicyDocument: | ||
Version: "2012-10-17" | ||
Statement: | ||
- Effect: Allow | ||
Action: "bedrock:InvokeModel" | ||
Resource: | ||
- !Sub "arn:aws:bedrock:${AWS::Region}::foundation-model/*" | ||
|
||
Outputs: | ||
BedrockAgentRoleArn: | ||
Description: The ARN of the Bedrock Agent Role | ||
Value: !GetAtt bedrockAgentRole.Arn | ||
Export: | ||
Name: !Sub '${AWS::StackName}-BedrockAgentRoleArn' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters