-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Certain CloudStack resources not added to tfstate #7583
Comments
@keith471 thanks for the report... Could you run your test again, but then do a |
@svanharmelen thanks for your reply! Here is the output of terraform plan after the first run:
And here is the debug output. I hope this helps! Let me know anything else that might be helpful. NOTE: This was after a fresh run of |
@keith471 is there any way you can test this with 0.7rc3? As I cannot reproduce this issue with the config you supplied in combination with 0.7rc3. So I'm guessing your problem is already been solved in master. NOTE: Do NOT use any existing config/state that you want to keep managing after your test! When using 0.7 your state will be updated and can no longer be used with older versions of Terraform! |
@svanharmelen just tested with 0.7rc3 with no luck unfortunately - I'm still seeing the same behavior. Any ideas? I'll do a bit of digging next Monday. |
@keith471 that is really weird... So if you look in CloudStack, I assume the resources are actually created right? So if you use the same keys as you are using with Terraform, can you query the resources using cloudmonkey? Do they show up and if so, what is the exact cloudmonkey command you used to list the resources? |
@svanharmelen this is weird indeed. Yes, the resources exist in CloudStack and I am able to query for them with cloudmonkey. Here are the commands I used: In both cases, the I also verified that there is no difference between the fields of the output of cloudmonkey and the output of
match the fields in the output from cloudmonkey. Any ideas? What more can I do to help? I'm happy to do anything you need. |
@keith471 oke... could you also check if you can query the resources with cloudmonkey if you do not specify the And could it be you are using a using that only has rights within the used project? I have the feeling it is somehow related to that. If we can proof that, it would be a relatively easy fix. |
@svanharmelen thanks! I cannot query the resources without specifying the The user's rights are not limited to the given project - they have rights to access one or more projects... |
@keith471 @svanharmelen Hey, I checked out the code, and it looks like the issue we had faced with the network ACLs. It is necessary to include the project ID to read resources that belong to projects (even though it is an ID; it is a limit of CS). This means that the resource can never be found after it is created, which means it will never populate the tfstate file |
@svanharmelen absolutely! Thank you! Just give me a shout when you've pushed the fix and I'd be more than happy to test it out. |
@keith471 all yours... The fix is in master so go ahead and give it a spin... |
@svanharmelen my apologies for the delay. That being said, I've tested out master and it works like a charm! Can we look forward to these changes in Terraform 0.7.0? Thanks again for your patience in working through this and for all your help! |
@keith471 no worries 😉 And yes, it's already in master so it will be part of 0.7.0 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
0.6.16
Affected Resource(s)
Of the many resources in my configuration, the only two I've encountered with this issue are:
cloudstack_static_nat
cloudstack_loadbalancer_rule
Terraform Configuration Files
Debug Output
terraform apply
to spin up all the infrastructureterraform apply
again.The debug output here was produced by the second step.
Expected Behavior
Should not have attempted to create the load balancer rule nor the static NAT as they already exist.
Actual Behavior
Attempts to create them, producing the following error output:
Steps to Reproduce
terraform apply
terraform plan
- you will see that the load balancer rule and static NAT are staged for creationterraform apply
References
It could be completely unrelated, but a similar-sounding past problem is #2584.
The text was updated successfully, but these errors were encountered: