-
Notifications
You must be signed in to change notification settings - Fork 9
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 wants to add new Fabric Enviroments that already exists if Capacity is Paused #141
Comments
Hi @SemUijen I appreciate your idea, but it seems more like a feature request than a bug. There are some potential issues:
I think lifecycle with postcondition as you proposed is a good reference how to handle it as own gate-keeper. I proposed this a part of our quick-start example: microsoft/fabric-terraform-quickstart#37 |
Those are indeed fair points! I agree that always failing if the capacity is not active is not the correct way to move forward. For me the expected behavior, should not be integrated in the what do you think? |
hi @SemUijen resource "fabric_environment" "example" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
} after your solution it will add one more for capacity: resource "fabric_environment" "example" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
capacity_id = "00000000-0000-0000-0000-000000000000"
} and under the hood each time the call to the API for capacity check will be executed, so basically we will double of the requests per each resource execution and that will cause throttling very easily. |
Good point. This would lead too many unnecessary calls. I was thinking about using it in the resource "fabric_environment" "example" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
} Maybe it should be caught in the error handling, but I do not think that the Rest APIs returns a specific error code/message for an inactive capacity |
@SemUijen actually workspace does not require capacity id and can be created without it. |
Hi @DariuszPorowski |
🐛 What happened?
When the Fabric Capacity is paused, the terraform provider wants to add already existing items. Currently, I only have Fabric Environments deployed so this issue might also occur for other Fabric Items(Lakehouses, notebooks, etc.).
If the Capacity is paused, the api will return 404 which might lead to the behavior of terraform wanting to deploy the item again
If this is the case, the terraform provider might need to check first if the Capacity is "running" before planning changes
🔬 How to reproduce?
🏗️ Code Sample / Log
No response
📷 Screenshots
No response
📈 Expected behavior
I added the following to create the expected behavior. This fixes the problem but it might be better to have the terraform provider to do this instead of a postcondition
🌌 Environment (Provider Version)
0.1.0-beta.5
🌌 Environment (Terraform Version)
1.10
🌌 Environment (OS)
macOS
📎 Additional context
No response
🔰 Code of Conduct
The text was updated successfully, but these errors were encountered: