Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability for heroku_team_collaborator to handle users that already exist on the app #318

Merged
merged 2 commits into from
Jul 19, 2021

Conversation

davidji99
Copy link
Collaborator

From my experience, people often manually add users to Heroku team apps outside of Terraform for a number of reasons. When the Terraform configuration is updated to reflect such out-of-band changes, people need to import the resource first before executing an apply. This PR will handle this scenario but checking for a specific error returned from resource creation indicating that the target user is on the target app. If so, find the collaborator ID, set it to the resource ID, and proceed with state refresh.

@davidji99 davidji99 requested a review from mars July 1, 2021 03:18
@davidji99
Copy link
Collaborator Author

@mars Thoughts on this?

Copy link
Member

@mars mars left a comment

Choose a reason for hiding this comment

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

This looks good @davidji99 👍 I really appreciate these little adaptations to make Terraform cooperate with external configuration changes.

… an app

By checking the error response of the API response received from resource creation.
If the error contains a certain string, find and set existing collaborator ID
to resource ID.
@davidji99 davidji99 force-pushed the heroku-team-collabor-enhancement branch from 373e055 to 08c153b Compare July 14, 2021 22:04
@davidji99 davidji99 merged commit 3da10b9 into master Jul 19, 2021
@davidji99 davidji99 deleted the heroku-team-collabor-enhancement branch July 19, 2021 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants