Central

Amplify Central Agent Configuration YAML and ENV Files

Amplify Central Agent Configuration YAML and ENV Files

Amplify Central agents enable you to connect your API Gateways to Amplify Central in order to have a single control pane to view all of your APIs and their associated traffic.

This reduces the need to switch between the various Gateways and to obtain a more holistic view of your API ecosystem and usage. Axway supports both its own API Gateway and non-Axway Gateways (AWS, Azure, MuleSoft…).

The agents are powerful and support many configurations and options (binary, Docker, EC2, Fargate, …).

When you install the agents using the CLI, there are YML and ENV files associated with the agents. These are used to configure the agent. For example, to specify the host URL and Port of your Gateway or to enable subscription event webhooks to trigger your custom API approval subscription flow.

While you can set all configuration options in either the YML file or ENV file or both, in general, it’s best practice to use environment files for all of your configurations.

Why? For example, when you install the agents for AWS Gateway for EC2, the YML files are embedded in a docker image and not easily editable so you will need to use the ENV file. But when you do a binary install of the agents for the Axway Gateway, you will see both YML and ENV. To make it easy to share configurations (e.g. for webhooks…), it makes sense to use the ENV file.

You can refer to the Reference for Agent Configuration for the environment variables.

For example, to set up a subscription flow webhook, you can use the YML file fragment shown below:

central:
  .
  .
  .
  subscriptions:
    approval:
      mode: webhook
      webhook:
        url: https://staging.cloud-elements.com/elements/api-v2/formulas/instances/465827/executions
        headers:
          Header=Authorization,Value=User IPJG.........869NW4=, Organization 79eb........c2a05

    notifications:
      webhook:
      smtp:
        host: email-smtp.us-east-1.amazonaws.com
        port: 587
        username: xxxxxxxxxxxxx
        password: yyyyyyyyyyyyy
        authtype: PLAIN
        fromAddress: noreply-demo@axway.com
    .
    .
    .

The ENV version is shown below:

.
.
.
CENTRAL_SUBSCRIPTIONS_APPROVAL_MODE=webhook
CENTRAL_SUBSCRIPTIONS_APPROVAL_WEBHOOK_URL=https://staging.cloud-elements.com/elements/api-v2/formulas/instances/465827/executions
CENTRAL_SUBSCRIPTIONS_APPROVAL_WEBHOOK_HEADERS=Header=Authorization,Value=User IPJG.......869NW4=, Organization 79eb......c2a05
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_HOST=email-smtp.us-east-1.amazonaws.com
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_PORT=587
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_USERNAME=xxxxxxxxxxxx
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_PASSWORD=yyyyyyyyyyyy
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_AUTHTYPE=PLAIN
CENTRAL_SUBSCRIPTIONS_NOTIFICATIONS_SMTP_FROMADDRESS=noreply-demo@axway.com
.
.
.

Notice how the YML tree structure is mapped to environment variables. For example, to set the subscription approval mode to webhook, in the YML, you traverse central -> subscriptions -> approval -> mode and set it to webhook. The corresponding entry in the ENV file is:

CENTRAL_SUBSCRIPTIONS_APPROVAL_MODE=webhook

Summary

While agent configuration can be performed using YML files and/or ENV files, it’s recommended to use ENV files. In some cases, you can only use ENV files since the YML file is embedded in a docker image. An example was provided to help you map between the two.

Learn more about Amplify Central.