Central

Amplify Central/Unified Catalog tag-based API Discovery – filter based on tag name

Amplify Central/Unified Catalog tag-based API Discovery

You can use API Gateway tags to control discovery by the Amplify Agents as described here.

While Amplify provides for flexible, robust, and granular control, in this introductory example, we’ll rely on the presence of a tag to control whether or not an AWS API Gateway API is discovered or not. This is referred to as Filter based on tag name. The same principles apply to other Gateways.

The AWS discovery agent environment variable is AWS_FILTER as described here. The tag I’ll use is SHOULD_DISCOVER. For my example, I don’t need a value as we’ll simply check to see if the tag exists. As such, only AWS APIs that you want to be discovered should have this tag set.

Setting up the API Tags

For example, my AWS API Gateway API’s are shown below:

AWS API Gateway APIs

I only want PetStore and ZooStore API’s to be discovered so I will set tags on these two APIs:

Add SHOULD_DISCOVER Tag to PetStore API
Add SHOULD_DISCOVER Tag to ZooStore API

but not the third as follows:

SHOULD_DISCOVER Tag NOT ADDED to the Third API

Discovery Agent Environment File

Add the following line to your da_env_vars.env file:

AWS_FILTER=tag.SHOULD_DISCOVER.Exists() == true

Refer to the Axway APIM and Azure Gateway Agent Configuration docs for configuring those agents.

Run your discovery agent and you will see that only the APIs with the SHOULD_DISCOVER tag (‘PetStore’ and ‘ZooStore’ but NOT ‘AWS HW API’) will be discovered as shown below:

Discovered APIs in the Axway Unified Catalog

Summary

In this post, we looked at using Gateway tags to control discovery. We looked at a simple example, Filter based on tag name. In future blog posts, we’ll look at other ways to leverage tags for discovery.

Learn more about API Gateways.