Giter VIP home page Giter VIP logo

Comments (4)

github-actions avatar github-actions commented on September 22, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

from terraform-provider-aws.

kmcduffee-verisk avatar kmcduffee-verisk commented on September 22, 2024

Currently I am solving the alias issue with the following:

resource "aws_bedrockagent_agent_alias" "demo" {
  agent_alias_name = "demo"
  agent_id         = aws_bedrockagent_agent.demo.agent_id
  description      = "Demo"
  routing_configuration {
    agent_version = data.external.latest_agent_version.result.agent_version
  }
}

data "external" "latest_agent_version" {
  program = ["bash","${path.module}/scripts/get_agent_details.sh",aws_bedrockagent_agent.demo.agent_id]
  depends_on = [ aws_bedrockagent_agent.demo ]
}
#!/usr/bin/env bash

AGENT_ID=$1
AGENT_VERSION=$(aws bedrock-agent list-agents --query "agentSummaries[?agentId=='${AGENT_ID}'].latestAgentVersion" --output text)

jq -n --arg agent_version "${AGENT_VERSION}" '{"agent_version":$agent_version}'

from terraform-provider-aws.

acwwat avatar acwwat commented on September 22, 2024

Just adding some observations here since I've been experimenting with the Bedrock Agents resources recently.

It seems that the agent_version in the context of aws_bedrockagent_agent is not very helpful because the value is supposedly hardcoded to DRAFT if you look at the API reference. But the actual behavior is also different or changing. I can see that the field is defined in the aws_bedrockagent_agent resource code as a computed attribute but it's being set to null because the AWS API is not returning it! When I called aws bedrock-agent get-agent in the CLI, the response does NOT include the agentVersion field.

It also doesn't help when versions are created only when an alias is created. So what I think we need is a new data source aws_bedrockagent_agent_versions to fetch the available versions for creating an alias pointing to a specific version.

from terraform-provider-aws.

drewtul avatar drewtul commented on September 22, 2024

Per @acwwat The version for a agent created via aws_bedrockagent_agent is always DRAFT, using aws_bedrockagent_agent_alias without routing_configuration will create a new version of the agent from the currently prepared DRAFT. That appears to be the only way to create a new version at this time.

You can also using the data source in #38792 to look up specific versions if you want to create an aws_bedrockagent_agent_alias to a specific version that already exists.

We should probably deprecate and remove agent_version as the API isn't returning it and it could only be DRAFT it's not providing anything useful.

As it stands I don't think this is a bug we can fix, the CreateAgentAlias API call is the only call that creates new versions of the agent.

from terraform-provider-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.