Need Clarification

0

Title: Getting error while deploying bedrock agent cloudformation template.

Requirements:

We have Created a Simple Cloudformation of Agent for Amazon Bedrock and deploy Agents with Claude 3 Haiku. In this Agents for Amazon Bedrock, i want add action group like Lambda functions

Cloudformation templete :

Description: "CFN stack for creating an agent" Resources: ExampleAgentResource: Type: AWS::Bedrock::Agent Properties: AgentName: "Example_Agent" AgentResourceRoleArn: "arn:aws:iam::992382787256:role/service-role/AmazonBedrockExecutionRoleForAgents_2JVPT4MQ391" FoundationModel: "anthropic.claude-3-haiku-20240307-v1:0" Instruction: "You are an IT agent who solves customer's problems" Description: "Description is here" IdleSessionTTLInSeconds: 900 ActionGroups: - ActionGroupName: "it_action" Description: "Testing latest IT Management action" ActionGroupExecutor: Lambda: "arn:aws:lambda:us-east-1:992382787256:function:Test-1"

According to the above code showing me this error .

Enter image description here

According to error we change the code and added Functionschema in the code

AWSTemplateFormatVersion: '2010-09-09' Description: "CFN stack for creating an agent" Resources: ExampleAgentResource: Type: AWS::Bedrock::Agent Properties: AgentName: "Example_Agent" AgentResourceRoleArn: "arn:aws:iam::992382787256:role/service-role/AmazonBedrockExecutionRoleForAgents_2JVPT4MQ391" FoundationModel: "anthropic.claude-3-haiku-20240307-v1:0" Instruction: "You are an IT agent who solves customer's problems" Description: "Description is here" IdleSessionTTLInSeconds: 900 ActionGroups: - ActionGroupName: "it_action" Description: "Testing latest IT Management action" ActionGroupExecutor: labda: "arn:aws:lambda:us-east-1:992382787256:function:Test-1" Functionschema: arn: "arn:aws:lambda:us-east-1:992382787256:function:Test-1"

After adding Functionschema to the template now its showing this error.

Enter image description here

Here’s the reference :- https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-agent.html

And in the reference document Functionschema is not define anywhere

So please help me out with this

thanks

3 個答案
0

Hello.

How about trying setting "ApiSchema"?
https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html

AWSTemplateFormatVersion: '2010-09-09' 
Description: "CFN stack for creating an agent" 
Resources: 
  ExampleAgentResource: 
    Type: AWS::Bedrock::Agent 
    Properties: 
      AgentName: "Example_Agent" 
      AgentResourceRoleArn: "arn:aws:iam::992382787256:role/service-role/AmazonBedrockExecutionRoleForAgents_2JVPT4MQ391" 
      FoundationModel: "anthropic.claude-3-haiku-20240307-v1:0" 
      Instruction: "You are an IT agent who solves customer's problems" 
      Description: "Description is here" 
      IdleSessionTTLInSeconds: 900 
      ActionGroups: 
        - ActionGroupName: "it_action" 
          Description: "Testing latest IT Management action" 
          ActionGroupExecutor: 
            Lambda: "arn:aws:lambda:us-east-1:992382787256:function:Test-1" 
          ApiSchema:
            Payload: ....
profile picture
專家
已回答 1 個月前
profile picture
專家
已審閱 1 個月前
0

Hello, It seems like the Function Schema property is not a valid property for the AWS::Bedrock::Agent resource in CloudFormation. The documentation you referenced (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-agent.html) confirms this.

AWSTemplateFormatVersion: '2010-09-09' Description: "CFN stack for creating an agent" Resources: ExampleAgentResource: Type: AWS::Bedrock::Agent Properties: AgentName: "Example_Agent" AgentResourceRoleArn: "arn:aws:iam::992382787256:role/service-role/AmazonBedrockExecutionRoleForAgents_2JVPT4MQ391" FoundationModel: "anthropic.claude-3-haiku-20240307-v1:0" Instruction: "You are an IT agent who solves customer's problems" Description: "Description is here" IdleSessionTTLInSeconds: 900 ActionGroups: - ActionGroupName: "it_action" Description: "Testing latest IT Management action" ActionGroupExecutor: Lambda: "arn:aws:lambda:us-east-1:992382787256:function:Test-1"

The ActionGroupExecutor property takes the format Lambda: <arn_of_lambda_function>. This directly specifies the Lambda function as the action executor. The FunctionSchema property might be relevant for future capabilities, but it's not currently supported for defining action group executors.

Let me know if you have any further questions about deploying your Bedrock agent with action groups!

Regards, Manish Batheja

已回答 1 個月前
0

Enter image description here

Tried from terraform as well but still showing me the same error.

Harsh
已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南