Adding an 'Approval' gate
To configure your workflow to require an approval, you must add the Approval gate to the workflow. Use the following instructions to add an Approval gate to your workflow.
For more information about this gate, see Requiring approvals on workflow runs.
- Visual
-
To add an 'Approval' gate to a workflow (visual editor)
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.
-
Choose Edit.
-
At the top-left, choose Gates.
-
In the Gates catalog, in Approval, choose the plus sign (+).
-
Choose Inputs, and in the Depends on field, do the following.
Specify an action, action group, or gate that must run successfully in order for this gate to run. By default, when you add a gate to a workflow, the gate is set to depend on the last action in your workflow. If you remove this property, the gate will not depend on anything, and will run first, before other actions.
Note
A gate must be configured to run before or after an action, action group, or gate. It cannot be set up to run in parallel with other actions, action groups, and gates.
For more information about the Depends on functionality, see Sequencing gates and actions.
-
Choose the Configuration tab.
-
In the Gate name field, do the following.
Specify the name you want to give the gate. All gate names must be unique within the workflow. Gate names are limited to alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). Spaces are not allowed. You cannot use quotation marks to enable special characters and spaces in gate names.
-
(Optional) In the Number of approvals field, do the following.
Specify the minimum number of approvals required to unlock the Approval gate. The minimum is
1
. The maximum is2
. If omitted, the default is1
.Note
If you want to omit the
ApprovalsRequired
property, remove the gate'sConfiguration
section from the workflow definition file. -
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.
- YAML
-
To add an 'Approval' gate to a workflow (YAML editor)
Open the CodeCatalyst console at https://codecatalyst.aws/
. -
Choose your project.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow. You can filter by the source repository or branch name where the workflow is defined, or filter by workflow name or status.
-
Choose Edit.
-
Choose YAML.
-
Add an
Approval
section and underlying properties using the following example as a guide. For more information, see the 'Approval' gate YAML in the Workflow YAML definition.Actions: MyApproval_01: Identifier: aws/approval@v1 DependsOn: - PreviousAction Configuration: ApprovalsRequired: 2
For another example, see Example: An 'Approval' gate.
-
(Optional) Choose Validate to validate the workflow's YAML code before committing.
-
Choose Commit, enter a commit message, and choose Commit again.