-
Notifications
You must be signed in to change notification settings - Fork 31
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
Circular dependency while creating an Application Gateway #3287
Comments
Hi @carlospega thanks for reaching out. Yes, Azure have set up their APIs in a way that do cause various circular dependencies. Here's a blog post from a while back which discusses these kinds of issues: https://www.pulumi.com/blog/exploring-circular-dependencies/ This is also descussed in the following issues:
Currently, the best approach is to do two deployments on the first run, one to create the resources without the cycle. Then a second deployment to update the second resource with a link back to the first as described in this comment: pulumi/pulumi#3021 (comment) |
hi @danielrbradley thanks for the answer. I'm not sure i understand correctly. The problem is that the API expects all the values at the first execution, so i'm not being able to create the application gateway on the first run because of errors like:
But the application gateway my-app-gateway0876017f is not being created and in the second execution it changes the name. The http_listener is required and it takes a frontend_ip_configuration reference which i can't create separately. Any idea on how to workaround this? Thanks! |
Hi @carlospega There is a way to solve this fairly simply by using relative IDs instead of full ones. You can use a special token
you do
You can see a full example in https://github.com/pulumi/pulumi-azure-native/blob/master/examples/py-loadbalancer/__main__.py#L37-L92 |
What happened?
I'm trying to create an ApplicationGateway and it seems like there are a couple of circular dependencies. The first problem i encounter is that for creating an application gateway i need to define an array of http_listeners. And because http_listener can't be created apart from the app gateway, and because it asks for
frontend_ip_configuration: Input[SubResourceArgs] | None = None
. I don't know how to procede.The same thing happens with the routing rule.
There's no way to create both object independently and then attach rules to the application gaateway.
Also, i tried constructing the id and reference it using
network.SubResourceArgs(id="/subscriptions/<subid>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/applicationGateways/my-app-gateway/frontendIPConfigurations/my-frontend-ip-configurtion"
, but the problem is that names are appended a suffix at creation time, so i can't infer what the name will be. (Also i think the id is checked at creation time, so it wouldn't exist anyway).Example
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: