Fix: App deployment via API bypassing an Enabled "Approval Provisioning" Policy


I recently worked with a customer fixing an issue they had when provisioning a terraform app from the API. If they provisioned from the UI it triggered their Enabled Morpheus provisioning approval policy, however when they provisioned via the API, the deployment was bypassing the approval policy.

The reason for this was as follows:

  1. The approval policy was scoped to Cloud X
  2. When deploying the App via the UI Cloud X was selected
  3. When deploying via the API the “defaultCloud” parameter was missed from the JSON body.

If you are hitting this problem please make sure you are including the defaultCloud parameter in the API payload so that Morpheus knows the cloud the app is scoped too. This parameter has been recently added to the docs.

Hope this helps others in the future!