Skip to content

Conversation

@marcinbelczewski
Copy link
Contributor

@marcinbelczewski marcinbelczewski commented Nov 26, 2025

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.

Description

Fixes the aws_bedrockagentcore_agent_runtime resource to properly handle computed default values for lifecycle_configuration attributes.

When using lifecycle_configuration with only max_lifetime specified (without idle_runtime_session_timeout), AWS automatically computes a default value for idle_runtime_session_timeout. The previous implementation used schema.ListAttribute which only marked the list as Optional+Computed, but the nested attributes were not marked as Computed. This caused Terraform to report "Provider produced inconsistent result after apply" when the API returned computed values.

The fix converts lifecycle_configuration from a schema.ListAttribute to a schema.ListNestedBlock where both idle_runtime_session_timeout and max_lifetime are explicitly marked as Optional: true, Computed: true. This allows the AWS API to return computed default values without triggering the inconsistent result error.

Relations

Closes #45290

References

Output from Acceptance Testing

% make testacc TESTS=TestAccBedrockAgentCoreAgentRuntime_lifecycleConfiguration PKG=bedrockagentcore

=== RUN   TestAccBedrockAgentCoreAgentRuntime_lifecycleConfiguration
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_lifecycleConfiguration
=== RUN   TestAccBedrockAgentCoreAgentRuntime_lifecycleConfigurationMaxLifetimeOnly
=== PAUSE TestAccBedrockAgentCoreAgentRuntime_lifecycleConfigurationMaxLifetimeOnly
=== CONT  TestAccBedrockAgentCoreAgentRuntime_lifecycleConfiguration
=== CONT  TestAccBedrockAgentCoreAgentRuntime_lifecycleConfigurationMaxLifetimeOnly
--- PASS: TestAccBedrockAgentCoreAgentRuntime_lifecycleConfigurationMaxLifetimeOnly (32.96s)
--- PASS: TestAccBedrockAgentCoreAgentRuntime_lifecycleConfiguration (48.21s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagentcore   55.494s

@github-actions
Copy link
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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/bedrockagentcore Issues and PRs that pertain to the bedrockagentcore service. size/L Managed by automation to categorize the size of a PR. external-maintainer Contribution from a trusted external contributor. labels Nov 26, 2025
@marcinbelczewski marcinbelczewski changed the title fix(aws_bedrockagentcore_agent_runtime): setting max lifetime lower than default idle aws_bedrockagentcore_agent_runtime: Fix lifecycle_configuration attributes to be properly computed when not specified Nov 26, 2025
@marcinbelczewski marcinbelczewski force-pushed the b-aws_bedrockagentcore_agent_runtime-lifecycle branch 2 times, most recently from f738765 to a30932b Compare November 26, 2025 23:10
@marcinbelczewski marcinbelczewski force-pushed the b-aws_bedrockagentcore_agent_runtime-lifecycle branch from a30932b to e07dfc3 Compare November 26, 2025 23:14
@marcinbelczewski marcinbelczewski marked this pull request as ready for review November 27, 2025 09:15
@marcinbelczewski marcinbelczewski requested a review from a team as a code owner November 27, 2025 09:15
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 4, 2025
@ewbankkit ewbankkit self-assigned this Dec 4, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 4, 2025
@ewbankkit ewbankkit removed their assignment Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Addresses a defect in current functionality. external-maintainer Contribution from a trusted external contributor. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/bedrockagentcore Issues and PRs that pertain to the bedrockagentcore service. size/L Managed by automation to categorize the size of a PR. 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.

[Bug]: aws_bedrockagentcore_agent_runtime lifecycle_configuration produces inconsistent result after apply

2 participants