salesforce / terraform-provider-anypoint

The official Terraform Provider for Mulesoft Anypoint Platform
https://registry.terraform.io/providers/mulesoft-anypoint/anypoint/latest/docs
MIT License
21 stars 17 forks source link

anypoint_apim_policy_custom resource : Order of policies can't be defined #93

Open vaibhav-yenorkar opened 2 months ago

vaibhav-yenorkar commented 2 months ago

I am using anypoint_apim_policy_custom resource to create and apply standard as well as custom policies to Flex Gateway API. However , I have noticed order of policies is random when applied to API.

Event though, 'order' attribute is supposed to be Read Only as per documentation, I have tried to add 'order' attribute while creating policy resources, but I am getting following error -

Error: Value for unconfigurable attribute │ │ with anypoint_apim_policy_custom.service-callout, │ on main.tf line 165, in resource "anypoint_apim_policy_custom" "service-callout": │ 165: order = 4 │ │ Can't configure a value for "order": its value will be decided automatically based on the result of applying this configuration.

I need help how the order of policies can be specified while creating them in TF template.

sabsfdc commented 2 months ago

@soufi - please take a look at this when you get some free time. Thanks

gavinpitchersky commented 2 months ago

Hi @soufi - Thanks so much for any help you can provide on this!

soufi commented 1 month ago

Hi, As of today, the order cannot be specified because Mulesoft's API doesn't allow it. But normally you policies are created one by one following the order of initialization. Terraform uses parallelism by default and execute 10 operations at the same time. If you want an absolute order, you can use the parallelism flag to make sure policies are created one after the other.

gavinpitchersky commented 1 month ago

Thanks for the information @soufi.

soufi commented 1 month ago

@sabsfdc this issue can be closed.