-
Notifications
You must be signed in to change notification settings - Fork 759
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
Unable to import github repo due to auto_init #148
Comments
Hi @gabrielsyapse We have discussed some long-term plans on improving the (currently limited) important functionality, but I'm afraid there isn't much better solution other than setting Prior to the 1.2 that field appeared updatable, but was in fact ignored, which may have caused some confusions and bugs. So the previous behaviour was actually wrong and now is fixed. I'm going to leave this open for reference, but it needs to be addressed at higher level (helper schema / core) and there's a lot of work currently underway related to 0.12, so I wouldn't expect this to be implemented before shipping that version later this year. |
@radeksimko Can you be more specific regarding the workaround? I've tried several options and the only one that avoided the recreate is to remove the flag from my module. But then I don't know how to accomplish an auto_init. What are the steps to auto_init on create and also avoid subsequent recreations? |
Our decision was to add a lifecycle of ignore_changes to |
My sincere apologies to everyone! 😑I drew conclusions before trying to reproduce it as it looked very similar to some other bugs I saw in the wild in the past. Basically I was under the impression that we just set I will raise a PR with patch and aim to get it shipped in |
Sorry again for the overlook from my side. Also I just realized (while testing my PR) that there is, in fact a workaround, and that is to omit the provider "github" {
organization = "terraform-providers"
}
resource "github_repository" "github_repository" {
name = "terraform-provider-github"
description = "Terraform GitHub provider"
homepage_url = "https://www.terraform.io/docs/providers/github/"
topics = ["terraform-provider", "github", "terraform"]
private = false
has_issues = true
has_wiki = false
has_downloads = true
allow_merge_commit = true
allow_squash_merge = true
allow_rebase_merge = true
default_branch = "master"
archived = false
}
|
After PR integrations#135, auto_init, license_template, and gitignore_template now all have ForceNew set to true, which means they *will* affect the resource after initial creation. See also PR integrations#148, integrations#155, integrations#164 Signed-off-by: Jordan Evans <jevans@linuxfoundation.org>
After PR integrations#135, auto_init, license_template, and gitignore_template now all have ForceNew set to true, which means they *will* affect the resource after initial creation. See also PR integrations#148, integrations#155, integrations#164 Signed-off-by: Jordan Evans <jevans@linuxfoundation.org>
Expected Behavior
Should be able to import an already created github repo and then run terraform apply without it wanting to recreate the repo.
Actual Behavior
In our terraform, we set the argument
auto_init = true
. Recently, there was a commit which changed the behavior. Before I was able to import an already created github repo into terraform state and then run apply, but now, it wants to recreate it, due to the ForceNew, which has been added. So, I can't safely import a repo.For now, I have pinned to v1.1.0 and then was able to proceed and had the expected behavior. It just wanted to modify the single argument.
References
https://github.com/terraform-providers/terraform-provider-github/pull/135
Version
Terraform v0.11.7
Affected Resource(s)
github_repository
The text was updated successfully, but these errors were encountered: