terraform-provider-tfe
terraform-provider-tfe copied to clipboard
Constant diff on `tfe_registry_module` with v0.51.1
Terraform Cloud/Enterprise version
Terraform Cloud
Terraform version
1.6.6
Terraform Configuration Files
resource "tfe_registry_module" "module" {
vcs_repo {
oauth_token_id = data.tfe_oauth_client.client.oauth_token_id
identifier = github_repository.module.full_name
display_identifier = github_repository.module.full_name
}
}
Debug Output
...
Expected Behavior
No diff when resource is up-to-date
Actual Behavior
Resources were stuck in a cycle of being destroyed and created again because of a diff in the vcs_repo
block.
Additional Context
We are using tag-based publishing for modules.
I also tried using the config
resource "tfe_registry_module" "module" {
vcs_repo {
tags = true
branch = ""
oauth_token_id = data.tfe_oauth_client.client.oauth_token_id
identifier = github_repository.module.full_name
display_identifier = github_repository.module.full_name
}
}
but this continued to show a diff and try to re-create the resources.
It appears this was introduced by https://github.com/hashicorp/terraform-provider-tfe/pull/1096. Downgrading to v0.50.0
resolves the issue.
We are seeing the same issue for our org. Downgrading to v0.50.0
to test now.
Downgrading to v0.50.0
works for us
Hi @brianpham We were able to fix this by adding the organisation argument to the tfe_registry_module resource block.
As it states in the docs, if you have module_providev specified or vcs_repo is used via a GitHub App you must have the organisation argument set.
Hope this helps
Hi! Great to "bump" into this issue here! :)
Noticed also this changed behaviour ; I had to do two things (using the latest provider version 0.52.0):
- added the TFE_ORGANIZATION variable (or, set the organization in the provider config)
- as we use tag-based publishing, first-time ever, I had to set this in our custom module (I think it's been a default to true earlier, looks like it at least)
And, we're not (still yet) using a GitHub app for GitHub access but the "old-school" OAuth. Hmm. Interesting.