Skip to main content

Approval actions

What is an approval action?

An approval action is a specification of which resources and actions require approval. It defines the conditions under which approvals are needed, such as deploying to a production environment or creating a new resource. To incorporate approvals, you need to set up an approval action that outlines what needs to be approved.

An action states which resource will be subject to approvals, here's an example:

POST /approval/action
{
"nrn": "organization=1:account=2:namespace=3:application=4",
"entity": "deployment",
"action": "deployment:create",
"dimensions": {
"environment": "production"
},
"on_policy_success": "manual",
"on_policy_fail": "manual"
}

Approvals can be configured for the following entities: deployment, scope, action and service:action

Enhancing Approval Actions with Policies

A crucial benefit for your approvals can be to tailor them with business logic. By creating policies, you can define specific conditions and rules that must be met for an approval to proceed. This ensures that approvals are consistent and adhere to your organization's standards and requirements.

To link a policy with an approval action, you can associate the policy with the action. This is done by making a POST request to the /approval/action/:id/policy endpoint, as shown below:

POST /approval/action/5678/policy
{
"policy_id": 1234
}