Read-after-write consistency issue on google_tags_tag_key_iam_member with conditions#16525
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @trodge, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
17c4dfe to
6dab61a
Compare
6dab61a to
8e2dea0
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 13 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
|
@trodge This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
Description
When applying an IAM binding on a tag key resource (
google_tags_tag_key_iam_member) that includes aconditionblock, the Terraform Google provider throws the following error:Root Cause
After investigating the provider traces, the issue stems from a read-after-write inconsistency:
As a result, the condition block is not returned by the read response (instead a hash is added in role name), causing the provider to consider the resource as absent and throwing an inconsistent state error.
Reproduction case
The error is triggered when a
conditionblock is defined on agoogle_tags_tag_key_iam_memberresource:Fix
The fix consists of explicitly requesting IAM Policy v3 in the
getIamPolicyread request body, by adding the following payload:{ "options": { "requestedPolicyVersion": 3 } }