Skip to content

Conversation

@stefanfreitag
Copy link
Contributor

@stefanfreitag stefanfreitag commented Dec 11, 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

See #45446 for full details. In short,

  • A first terraform apply for the resource works as expected.
  • Modiying the resource and then running a second terraform apply gives a failure.

In #45446 the policy document argument of the resource was modified and terraform apply ended in

│ Error: Provider returned invalid result object after apply
│ 
│ After the apply operation, the provider still indicated an unknown value for aws_xray_resource_policy.foo.policy_revision_id. All values must be known after
│ apply, so this is always a bug in the provider and should be reported in the provider's own repository. Terraform will still save the other known object values in the state.

Relations

Closes #45446

References

Output from Acceptance Testing

Added a test case that updates the policy document argument multiple times.

make testacc TESTS=TestAccXRayResourcePolicy_ PKG=xray
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 b-aws_xray_resource_policy-fix-invalid-object-after-apply 🌿...
TF_ACC=1 go1.24.11 test ./internal/service/xray/... -v -count 1 -parallel 20 -run='TestAccXRayResourcePolicy_'  -timeout 360m -vet=off
2025/12/11 20:54:15 Creating Terraform AWS Provider (SDKv2-style)...
2025/12/11 20:54:15 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccXRayResourcePolicy_basic
=== PAUSE TestAccXRayResourcePolicy_basic
=== RUN   TestAccXRayResourcePolicy_policyDocument
=== PAUSE TestAccXRayResourcePolicy_policyDocument
=== RUN   TestAccXRayResourcePolicy_disappears
=== PAUSE TestAccXRayResourcePolicy_disappears
=== CONT  TestAccXRayResourcePolicy_basic
=== CONT  TestAccXRayResourcePolicy_disappears
=== CONT  TestAccXRayResourcePolicy_policyDocument
--- PASS: TestAccXRayResourcePolicy_basic (24.74s)
--- PASS: TestAccXRayResourcePolicy_disappears (26.17s)
--- PASS: TestAccXRayResourcePolicy_policyDocument (66.96s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/xray       67.119s

@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/xray Issues and PRs that pertain to the xray service. size/M Managed by automation to categorize the size of a PR. external-maintainer Contribution from a trusted external contributor. labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-maintainer Contribution from a trusted external contributor. needs-triage Waiting for first response or review from a maintainer. service/xray Issues and PRs that pertain to the xray service. size/M 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.

aws_xray_resource_policy invalid result object after apply

1 participant