update website doc to depict the use of sets in members resource #767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Related Issue: 761
Terraform creates an instance for each member of a given set, when
for_each
is used to configure a resource block.If
for_each
is used with resources that do bulk management like thetfe_team_organization_members
andtfe_team_members
, it results in the creation of multiple instances managing the same set of resources. See the example config below:The above config results in multiple instances of
tfe_team_organization_members
managing a set of memberships. Running an Apply will succeed. During the destroy phase, each instance of thetfe_team_organization_members
resource attempts to delete the same organization members. The first delete request succeeds but the subsequent requests fail. If there aren
number oflocal.all_users
, there will ben
DELETE API request made with the same membership id set (the current delete implementation attempts to delete all existing memberships).What is needed here, is for Terraform to create just
1 instance
oftfe_team_organization_members
which will manage all the organization members in the set. Thefor
expression will accomplish this, see the updated tfe_team_organization_members config below:After investigating this issue, the conclusion is that it is beneficial to add this use case example to the doc hence this PR.
Testing plan
External links
Output from acceptance tests