Skip to content

feat(bedrockagentcore): Memory and Memory Strategy resources - #44306

Merged
johnsonaj merged 24 commits into
hashicorp:mainfrom
marcinbelczewski:f-bedrockagentcore-memory
Oct 22, 2025
Merged

feat(bedrockagentcore): Memory and Memory Strategy resources#44306
johnsonaj merged 24 commits into
hashicorp:mainfrom
marcinbelczewski:f-bedrockagentcore-memory

Conversation

@marcinbelczewski

@marcinbelczewski marcinbelczewski commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

⚠️ Preview Service Notice

Amazon Bedrock AgentCore is currently in preview. This PR contains preview features and might not be merged until the service reaches General Availability (GA), depending on maintainer decisions. The implementation may be subject to breaking changes as the service evolves.

Amazon Bedrock AgentCore is now GA

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

No changes to security controls in this pull request. The implementation follows standard AWS provider patterns for IAM role assumptions and secure memory storage configurations.

Description

This PR implements Memory resources for Amazon Bedrock AgentCore:

  • aws_bedrockagentcore_memory resource for storing conversation context for AI agents
  • aws_bedrockagentcore_memory_strategy resource used to extract and consolidate memories for long-term storage

These resources enable AI agents to maintain conversational context and build long-term memory capabilities. The memory strategy supports both standard and custom configurations for memory extraction and consolidation.

Dependencies

This PR depends on #43738 which fixes a bug in AutoFlex field matching. Once that PR is merged, this branch will be rebased to remove the fix commit and rely on the trunk version.

Relations

Closes #43424

This PR is part of a series of smaller PRs split from the original large PR #43685:

References

Output from Acceptance Testing

make testacc PKG=bedrockagentcore TESTS='^TestAcc'
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-bedrockagentcore-memory 🌿...
TF_ACC=1 go1.24.6 test ./internal/service/bedrockagentcore/... -v -count 1 -parallel 20 -run='^TestAcc'  -timeout 360m -vet=off
2025/09/16 12:37:51 Creating Terraform AWS Provider (SDKv2-style)...
2025/09/16 12:37:51 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccBedrockAgentCoreMemoryStrategy_standard
=== PAUSE TestAccBedrockAgentCoreMemoryStrategy_standard
=== RUN   TestAccBedrockAgentCoreMemoryStrategy_custom
=== PAUSE TestAccBedrockAgentCoreMemoryStrategy_custom
=== RUN   TestAccBedrockAgentCoreMemoryStrategy_disappears
=== PAUSE TestAccBedrockAgentCoreMemoryStrategy_disappears
=== RUN   TestAccBedrockAgentCoreMemory_full
=== PAUSE TestAccBedrockAgentCoreMemory_full
=== RUN   TestAccBedrockAgentCoreMemory_disappears
=== PAUSE TestAccBedrockAgentCoreMemory_disappears
=== CONT  TestAccBedrockAgentCoreMemoryStrategy_standard
=== CONT  TestAccBedrockAgentCoreMemory_full
=== CONT  TestAccBedrockAgentCoreMemoryStrategy_disappears
=== CONT  TestAccBedrockAgentCoreMemoryStrategy_custom
=== CONT  TestAccBedrockAgentCoreMemory_disappears
--- PASS: TestAccBedrockAgentCoreMemory_disappears (15.60s)
--- PASS: TestAccBedrockAgentCoreMemory_full (53.41s)
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_disappears (253.77s)
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_standard (281.04s)
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_custom (296.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore	302.914s

@github-actions

Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions Bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. sweeper Pertains to changes to or issues with the sweeper. generators Relates to code generators. service/bedrockagentcore Issues and PRs that pertain to the bedrockagentcore service. size/XL Managed by automation to categorize the size of a PR. external-maintainer Contribution from a trusted external contributor. labels Sep 16, 2025
@marcinbelczewski
marcinbelczewski force-pushed the f-bedrockagentcore-memory branch from 46031ac to 6387ef6 Compare September 16, 2025 13:35
@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 16, 2025
@marcinbelczewski
marcinbelczewski marked this pull request as ready for review September 16, 2025 15:43
@marcinbelczewski
marcinbelczewski requested a review from a team as a code owner September 16, 2025 15:43
@marcinbelczewski
marcinbelczewski force-pushed the f-bedrockagentcore-memory branch 4 times, most recently from 59631cc to 0a41e1d Compare October 8, 2025 11:06
@marcinbelczewski
marcinbelczewski force-pushed the f-bedrockagentcore-memory branch from 0a41e1d to bfc924e Compare October 8, 2025 13:29
@ewbankkit ewbankkit self-assigned this Oct 8, 2025
@github-actions github-actions Bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 8, 2025
Marcin Belczewski added 2 commits October 8, 2025 18:21
…f-bedrockagentcore-memory

# Conflicts:
#	internal/service/bedrockagentcore/exports_test.go
#	internal/service/bedrockagentcore/memory_strategy.go
#	internal/service/bedrockagentcore/memory_strategy_test.go
#	internal/service/bedrockagentcore/service_package_gen.go
#	internal/service/bedrockagentcore/sweep.go
@marcinbelczewski
marcinbelczewski force-pushed the f-bedrockagentcore-memory branch from ce8463b to 76c3b7f Compare October 8, 2025 17:01
ewbankkit and others added 17 commits October 9, 2025 14:41
% make testacc TESTARGS='-run=TestAccBedrockAgentCoreMemory_' PKG=bedrockagentcore
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 HEAD 🌿...
TF_ACC=1 go1.24.6 test ./internal/service/bedrockagentcore/... -v -count 1 -parallel 20  -run=TestAccBedrockAgentCoreMemory_ -timeout 360m -vet=off
2025/10/09 14:59:34 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/09 14:59:34 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccBedrockAgentCoreMemory_basic
=== PAUSE TestAccBedrockAgentCoreMemory_basic
=== RUN   TestAccBedrockAgentCoreMemory_tags
=== PAUSE TestAccBedrockAgentCoreMemory_tags
=== RUN   TestAccBedrockAgentCoreMemory_disappears
=== PAUSE TestAccBedrockAgentCoreMemory_disappears
=== CONT  TestAccBedrockAgentCoreMemory_basic
=== CONT  TestAccBedrockAgentCoreMemory_disappears
=== CONT  TestAccBedrockAgentCoreMemory_tags
--- PASS: TestAccBedrockAgentCoreMemory_basic (16.78s)
--- PASS: TestAccBedrockAgentCoreMemory_disappears (17.69s)
--- PASS: TestAccBedrockAgentCoreMemory_tags (47.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore	53.249s

@johnsonaj johnsonaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

% make testacc TESTARGS='-run=TestAccBedrockAgentCoreMemory_' PKG=bedrockagentcore

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-bedrockagentcore-memory 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/bedrockagentcore/... -v -count 1 -parallel 20  -run=TestAccBedrockAgentCoreMemory_ -timeout 360m -vet=off
2025/10/22 13:33:44 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/22 13:33:44 Initializing Terraform AWS Provider (SDKv2-style)...
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_emptyProviderOnlyTag (229.31s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_ComputedTag_OnUpdate_Replace (243.09s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_nullNonOverlappingResourceTag (246.97s)
--- PASS: TestAccBedrockAgentCoreMemory_disappears (248.05s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_ComputedTag_OnCreate (253.60s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_EmptyMap (255.96s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_emptyResourceTag (264.70s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_AddOnUpdate (268.62s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_null (276.60s)
--- PASS: TestAccBedrockAgentCoreMemory_memoryExecutionRole (280.39s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_ComputedTag_OnUpdate_Add (293.67s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_EmptyTag_OnCreate (298.24s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_nonOverlapping (313.05s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_updateToResourceOnly (313.86s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_EmptyTag_OnUpdate_Add (324.11s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_updateToProviderOnly (335.32s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_IgnoreTags_Overlap_DefaultTag (335.57s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_EmptyTag_OnUpdate_Replace (345.89s)
--- PASS: TestAccBedrockAgentCoreMemory_tags (357.06s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_providerOnly (367.27s)
--- PASS: TestAccBedrockAgentCoreMemory_basic (221.88s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_nullOverlappingResourceTag (230.91s)
--- PASS: TestAccBedrockAgentCoreMemory_description (232.49s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_IgnoreTags_Overlap_ResourceTag (248.22s)
--- PASS: TestAccBedrockAgentCoreMemory_tags_DefaultTags_overlapping (273.31s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore	510.740s
% make testacc TESTARGS='-run=TestAccBedrockAgentCoreMemoryStrategy_' PKG=bedrockagentcore

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-bedrockagentcore-memory 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/bedrockagentcore/... -v -count 1 -parallel 20  -run=TestAccBedrockAgentCoreMemoryStrategy_ -timeout 360m -vet=off
2025/10/22 13:45:03 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/22 13:45:03 Initializing Terraform AWS Provider (SDKv2-style)...
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_disappears (216.68s)
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_standard (263.04s)
--- PASS: TestAccBedrockAgentCoreMemoryStrategy_custom (288.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore	296.260s

@johnsonaj

Copy link
Copy Markdown
Member

@marcinbelczewski thank you for the contribution! 🎉

@johnsonaj
johnsonaj merged commit f0b68bf into hashicorp:main Oct 22, 2025
47 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. 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 v6.18.0 milestone Oct 22, 2025
@github-actions github-actions Bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 23, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This functionality has been released in v6.18.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!

@github-actions

Copy link
Copy Markdown
Contributor

I'm going to lock this pull request 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 related to this change, 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 Nov 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Introduces or discusses updates to documentation. external-maintainer Contribution from a trusted external contributor. generators Relates to code generators. new-resource Introduces a new resource. service/bedrockagentcore Issues and PRs that pertain to the bedrockagentcore service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock AgentCore Support

5 participants