This topic describes how to bind a plug-in to an API group and verify whether the plug-in takes effect on the APIs in the group.
1. Overview
A plug-in is an independent configuration component provided by API Gateway. You can use a plug-in to implement custom features for your API. A plug-in must be bound to an API to take effect. If you have a large number of APIs, binding and managing plug-ins can be complicated and time-consuming. To resolve this issue, API Gateway allows you to bind plug-ins to API groups. A plug-in bound to an API group takes effect on all APIs in the group. If a plug-in of the same type is separately bound to an individual API in the group, the separately bound plug-in takes precedence.
2. Usage notes
You can bind only one plug-in of the same type to an API group.
After a plug-in is bound to an API group in a specified environment, the plug-in configurations take effect on all APIs of the group that are published in the environment.
If a plug-in of the same type is separately bound to an individual API in a group, the separately bound plug-in takes precedence.
The binding, unbinding, and update of plug-ins take effect immediately. You do not need to republish APIs for the changes to take effect. Therefore, for APIs with high risks, we recommend that you verify the change in the test environment before you make a change in the production environment.
A plug-in bound to an API group cannot be deleted.
3. Quick start
Log on to the API Gateway console and choose OpenAPI > Plug-ins in the left-side navigation pane.
Click Create Plug-in. In this example, an IP address-based access control plug-in is created.
Configure rules and then click Create. The plug-in appears in the plug-in list.
Click Bind to Group in the Actions column. Then select the group to bind the plug-in to and the environment to bind the plug-in in.
Test the plug-in on an API in the group that is published in the specified environment.
Test the plug-in on other APIs in the group that are published in the specified environment.
The preceding figures show that the plug-in takes effect on all APIs in the group.
If a plug-in of the same type is separately bound to an individual API in the group, the separately bound plug-in takes precedence.
4. Limits
The metadata of a plug-in cannot exceed 50 KB in size.
Each Alibaba Cloud account can create a maximum of 10,000 plug-ins in each region. Plug-ins created by the Resource Access Management (RAM) users that belong to the Alibaba Cloud account are counted against this quota.
The JSON Web Token (JWT) plug-in cannot be debugged by using the console. We recommend that you use Postman or client URL (
cURL) to debug JWT plug-ins.