Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Service]: aws_bedrockagent #35543

Closed
6 tasks done
jgard opened this issue Jan 29, 2024 · 14 comments · Fixed by #36669 or #37158
Closed
6 tasks done

[New Service]: aws_bedrockagent #35543

jgard opened this issue Jan 29, 2024 · 14 comments · Fixed by #36669 or #37158
Labels
new-resource Introduces a new resource. new-service Introduces a new service. service/bedrockagent Issues and PRs that pertain to the bedrockagent service.
Milestone

Comments

@jgard
Copy link

jgard commented Jan 29, 2024

Description

Support for Bedrock Agent configuration

Requested Resource(s) and/or Data Source(s)

resources

(and data sources for each)

Potential Terraform Configuration

resource "aws_bedrockagent" "this" {
  name="my_agent"
  instruction="I am a bedrock agent(...)"
  foundation_model="anthropic.claude-instant-v1"
  description="My agent description"
  idle_session_ttl_seconds=1800
  resource_role_arn = "arn:aws:iam:::roles/myagentrole"
  tags {
    mytag="myvalue"
  }
  #customer_encryption_key_arn = ""
  #prompt_override_configuration {}
}

resource "aws_bedrockagent_action_group" "this" {
  name="my_agent_action_group"
  description="My agent action group description"
  parent_action_group_signature = "AMAZON.UserInput"
  action_group_executor {
    lambda="arn:aws:lambda:region:account:function:my-agent-lambda"
  }
  api_schema = {
    s3 {
      bucket_name="my-agent-bucket"
      key = "my-agent.json"
    }
    #payload = jsonencode({}) #alternative, direct upload
  }
  state="ENABLED"
}

resource "aws_bedrockagent_alias" "this" {
  agent_id = aws_bedrock_agent.this.id
  name = "my_agent_alias"
}

resource "aws_bedrockagent_knowledge_base" "this" {
  name = "my_knowledge_base"
  description = "My bedrock knowledge base"
  role_arn = "arn:aws:iam::account:role/AmazonBedrockExecutionRoleForKnowledgeBase_my_agent"
  configuration {
    type = "VECTOR"
    vector_knowledge_base_configuration {
      embedding_model_arn = "arn:aws:bedrock:REGION::foundation-model/my-embedding-model"
    }
  }
  storage_configuration {
    type="OPENSEARCH_SERVERLESS"
    opensearch_serverless_configuration {
      collection_arn = "arn:aws:aoss:REGION:ACCOUNT:collection/my-collection"
      vectorIndexName = "bedrock-knowledge-base-default-index"
      field_mapping {
        vector_field = "bedrock-knowledge-base-default-vector"
        text_field = "AMAZON_BEDROCK_TEXT_CHUNK"
        metadata_field = "AMAZON_BEDROCK_METADATA"
      }
    }
  }
  tags {
    mytag="myvalue"
  }
}

resource "aws_bedrockagent_data_source" "this" {
  knowledge_base_id = aws_bedrock_knowledge_base.this.id
  name = "my_data_source"
  description = "My bedrock datasource"
  configuration {
    type = "S3"
    s3_configuration {
      bucket_arn = "arn:aws:s3:::my-data-source-bucket"
      inclusion_prefixes = ["prefix1","prefix2"]
    }
  }
  #server_side_encryption_configuration {
  #  kms_key_arn = ""
  #}
  vector_ingestion_configuration {
    chunking_configuration {
      chunking_strategy = "FIXED_SIZE"
      fixed_size_chunking_configuration {
        max_tokens = 300
        overlap_percentage = 5
      }
    }
  }
}

resource "aws_bedrockagent_knowledge_base_association" "this" {
  agent_id = aws_bedrock_agent.this.id
  agent_version = "my_agent_version"
  knowledge_base_id = aws_bedrock_agent_knowledge_base.this.id
  description = "helps answer questions for the agent on this specific subject"
  state = "ENABLED"
}

References

Would you like to implement a fix?

None

@github-actions github-actions bot added the service/bedrock Issues and PRs that pertain to the bedrock service. label Jan 29, 2024
Copy link

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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 29, 2024
@jgard jgard changed the title [New Service]: Bedrock-Agent [New Service]: aws_bedrock_agent Jan 29, 2024
@justinretzolk justinretzolk added new-service Introduces a new service. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 29, 2024
@nrnrk
Copy link
Contributor

nrnrk commented Feb 2, 2024

Is anyone working on this? If not, I'd like to.

@ewbankkit
Copy link
Contributor

The new resources should use aws_bedrockagent_ as a prefix, not aws_bedrock_agent.

@github-actions github-actions bot added the service/bedrockagent Issues and PRs that pertain to the bedrockagent service. label Feb 12, 2024
@theolrtpwc
Copy link

I don't see all these terraform resource blocks available on aws-provider v5.38.0.
But it is mentioned here that they have been added to v5.36.0.
Can anyone shed some light on this?

@nrnrk
Copy link
Contributor

nrnrk commented Feb 27, 2024

Resource implementations are not done yet. I'm working on aws_bedrockagent_agent resource now.

@theolrtpwc
Copy link

Do you have any idea of the release date of this feature ?

@kpx-dev
Copy link

kpx-dev commented Feb 27, 2024

@nrnrk thanks for your awesome work on this. I’m also very interested in adopting this soon. Can you please help share ETA or anything else I can help to speed this up?

@theolrtpwc
Copy link

theolrtpwc commented Mar 11, 2024

thanks @nrnrk ! I’m eager to adopt it soon. Could you please provide an ETA or any other information that might help accelerate its progress?

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.47.0 milestone Apr 19, 2024
@ewbankkit ewbankkit reopened this Apr 19, 2024
@ewbankkit ewbankkit removed this from the v5.47.0 milestone Apr 19, 2024
@ewbankkit ewbankkit changed the title [New Service]: aws_bedrock_agent [New Service]: aws_bedrockagent Apr 24, 2024
@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed service/bedrock Issues and PRs that pertain to the bedrock service. labels May 2, 2024
Copy link

github-actions bot commented May 3, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.49.0 milestone May 3, 2024
Copy link

This functionality has been released in v5.49.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@ixolt
Copy link

ixolt commented May 10, 2024

it seems to me it was missed aws_bedrockagent_knowledge_base_data_source resource

@purplexed
Copy link

purplexed commented May 10, 2024

@ixolt I think this is covered by the aws_bedrockagent_data_source.

However, there are a few issues with that:

  1. The documentation is just the default generated template, I raised a ticket for that: [Docs]: aws_bedrockagent_data_source doc is rather empty #37420
  2. The example shown above in the thread is wrong, the resource expects data_source_configuration instead of the configuration block.
  3. The import doesn't look like it's working with just the data source ID, but instead it has to be in the form of data_source_id,knowledge_base_id.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. new-service Introduces a new service. service/bedrockagent Issues and PRs that pertain to the bedrockagent service.
Projects
None yet
8 participants