Skip to main content

Google Cloud Apigee


  1. A GraphQL route configured for the Apigee with flowing traffic to a GraphQL server.
  2. An Inigo account setup as documented in our Getting Started guide.
  3. From #2, An Inigo service token value to set an INIGO_SERVICE_TOKEN environment variable.

Inigo's Apigee integration uses Apigee's ExternalCallout Policy to process GraphQL requests coming through Apigee's API Proxy. The Inigo agent will then apply Inigo's observability and security features for your GraphQL API that is proxied through Apigee.

Apply the GraphQL Schema to Inigo

When using the Apigee agent integeration, the GraphQL schema must be managed by Inigo to take full advantage of the observability, security, and API management functions that Inigo offers. The schema can be configured using the Service configuration, and applied using inigo apply per the documentation. With a published schema, the Inigo plugin will be able to download and apply the latest schema version.

Note: When using the Apigee agent integration, it's recommended to integrate Inigo into your CI/CD pipeline to automate the schema deployments.

Deploy Inigo Apigee Agent in Cloud Run

An inigohub/inigo_apigee_agent Inigo agent container image is available specifically for use as an ExternalCallout. It's recommended to deploy the agent in Google Cloud Run, as shown in Figure 1.

Figure 1. Create a Target Server for the ExternalCallout.

IMPORTANT: Use the INIGO_SERVICE_TOKEN as an environment variable when configuring the Cloud Run service.

The Container port is 8080 and the default Google Cloud Run settings are sufficient to get started. After deployment, a URL will be generated that is running on port 443 and will be used to configure the ExternalCallout.

Set Up Target Server for Inigo Agent

In Apigee, under Management -> Environments -> Target Servers click Create Target Server. Enter a unique Target Server name and a Host URL for your Cloud Run Inigo Agent URL. Set the Protocol to be gRPC - External callout with a Port of 443, as shown in Figure 2.

Figure 2. Create a Target Server for the ExternalCallout.

Set Up the ExternalCallout Policy

Under API proxies -> Proxy -> DEVELOP click the + button next to Policies. Next, create an EC-INIGO policy of type External Callout, as shown in Figure 3.

Figure 3. Create the ExternalCallout Policy.

Next, the ExternalCallout XML must be set. The following is a sample XML that can be modified for your <Server name= from the Target Server (see above):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExternalCallout continueOnError="false" enabled="true" name="EC-INIGO">
<Server name="inigo-agent"/>
<Property name="with.request.content">true</Property>
<Property name="with.request.headers">true</Property>
<Property name="with.response.content">true</Property>
<Property name="with.response.headers">true</Property>

After setting the XML for the ExternalCallout, click Save and then click Deploy, as shown in Figure 4.

Figure 4. After Setting the ExternalCallout Policy XML.

Add a RaiseFault

Next, click Add for the PreFlow. Create a RaiseFault with the following XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RaiseFault continueOnError="false" enabled="true" name="RF-INIGO-GUARD">
<Payload contentType="application/json">{inigo-response}</Payload>

Click Save again and then Edit the PreFlow XML to add inigo-has-response=true <Condition> for RF-INIGO-GUARD as follows:

<PreFlow name="PreFlow">
<Condition>inigo-has-response=true</Condition> <!-- Add this Condition to the PreFlow -->

After configuring the PreFlow, you will see a representation, as shown in Figure 5.

Figure 5. After Setting the RaiseFault XML.

After clicking Save and Deploy, select the Environment to deploy to. Once the depoyment is completed, the ExternalCallout will be activated, and all GraphQL queries will be observed and secured by the Inigo agent.