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

Constant diff on tfe_registry_module with v0.51.1 #1216

Open
jamesmbourne opened this issue Jan 16, 2024 · 4 comments · May be fixed by #1357
Open

Constant diff on tfe_registry_module with v0.51.1 #1216

jamesmbourne opened this issue Jan 16, 2024 · 4 comments · May be fixed by #1357
Labels

Comments

@jamesmbourne
Copy link

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.

Screenshot 2024-01-16 at 13 34 30

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 #1096. Downgrading to v0.50.0 resolves the issue.

@brianpham
Copy link

We are seeing the same issue for our org. Downgrading to v0.50.0 to test now.

@brianpham
Copy link

Downgrading to v0.50.0 works for us

@LiamLogan1996
Copy link

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

@iniinikoski
Copy link

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):

  1. added the TFE_ORGANIZATION variable (or, set the organization in the provider config)
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants