-
Notifications
You must be signed in to change notification settings - Fork 2
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
[ BUG ] - Terraform apply failed with error Wallix resource "already exists" for the newly creating resource #34
Comments
Is this issue Happening while passing a list of Authorization that what changed in it's order ? |
Thanks for the response. This issue happens randomly in different Wallix TF resource block and not always in same resource block. Please review the below details and let me know if you need further details to analysis this issue. The Authentication is performed using Wallix token in the provider block as mentioned below. We are not using modules and currently using Wallix TF resource blocks directly. The Wallix resource blocks are configured in the following order with depends_on (where ever applicable to perform the execution in the order, just for safer side) and "provider" parameter explicitly mentioned in all resource block.
FYI - As mentioned earlier, our Wallix Server is still v8 and we are migrating to v9/v10 shortly. |
For migration, you may want to migrate to v12 directly. Really good improvements. I can see a lot of declarative depends_on, I add a lot of issues using them in the past with beahaviour like you present. Try to use modules instead and proper dependencies resources. You may also want to test to generate a dependency graph to visualize change. I imagine you may have value that change it's order in the list and lead to this. Without the code it's going to be very difficult to investigate. |
Thanks for your feedback and suggestion. Do we have any official Terraform Wallix Module? or you are advising us to create the Wallix TF modules? Please confirm. I will share our existing Terraform Wallix code for your analysis and feedback asap. |
We don't have modules yet. You should create them depending on your needs. You can share your code here if nothing sensible in it. If you are unsure, provide it by creating a support ticket on our support portal. Best regards, |
Thanks for your response. I will share our code after removing the sensible items. I will check the possibility of sharing the code through support portal. Will keep you update. |
Hello @bsimon-wallix - Sorry for the delay. Is it possible to share our code privately to you for your review and feedback? Please advise. |
Yes it is possible. Sorry for the delay, I was on leave. |
**Describe
the bug**The Terraform Wallix provider version currently used is version 0.12.2. The Terraform version used is v1.8.4.
The Terraform Apply stage failed with the error Wallix resource "already exists" even though the resource is being created for the first time. This issue occurs for 1 out of 10 TF Apply.
We observed the TF Apply actually creating the resource in Wallix side (using Wallix API), but not updating the creation status in the Terraform State file and immediately failing with the error "Resource already exist" (during the same Terraform apply execution).
The following Terraform PLAN and APPLY result may explain this issue more clearly.
TF PLAN result:
wallix-bastion_authorization.auth-rdp[0] will be created
]
}
TF Apply result:
Error: authorization_name auth-gcp-XXXXX-YYY-ope-rdp already exists
│
│ with wallix-bastion_authorization.auth-rdp[0],
│ on tbr.tf line 691, in resource "wallix-bastion_authorization" "auth-rdp":
│ 691: resource "wallix-bastion_authorization" "auth-rdp" {
Expected behavior
During Terraform Apply for the new Wallix resource creation, the Wallix resource creation and the Terraform State update must be completed successfully without getting the error resource "already exists".
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: