Apigee X Integration - Runtime values

Hi, I am new to Apigee X integrations and I am exploring how to make values dynamic, example REST endpoint or anything which changes with environments like target REST endpoint is https://abc.com in dev and it changes to https://abc.qa.com in QA environment. Will it be a manual change every time? 

@dchiesa1 : Could you help 🙂

1 5 260
5 REPLIES 5

There are lots of approaches. 

The basis for all of these is that the configuration of Apigee is all accessible via API, and thus automation.  That means you don't need to "manually" change anything as you deploy things. 

One approach is to use the maven deploy plugin as part of your CI/CD process. It will replace placeholders in your API Proxy configuration, so that you can use qa.abc.com as a target URL in one environment, and prod.abc.com in another. This "placeholder" approach works with lots of other things besides target URLs. The documentation for the maven deploy plugin is current and examples are available. Many customers use this as part of their CI/CD pipeline.  Here is a complete implementation of a pipeline, including the deploy plugin and a few other steps.  This plugin, or a similar placeholder+templating approach, would be appropriate if you are changing "many things" beyond just the target url. 

Another approach, which applies specifically to target URLs, is to use "target servers", within Apigee.  You can have a named target server, such as "target1", cnfigured in environment1, which points to qa.abc.com, while a similarly named target server in environment2 points to prod.abc.com . Just reference "target1" in your API proxy and it will do the right thing, depending on the environment in which the proxy is operating. This is ALSO used by many customers, and is well proven. 

 

@dchiesa1 I guess the solution which you are suggesting above is specific for API proxy and resources . But my question was related to Integrations and specifically for REST endpoint task (feature of APIGEE X) . Attaching the Screenshot of small poc. 

Screenshot 2023-08-30 at 10.13.59.png

oh, I'm sorry! I misunderstood that.  @shaaland may want to comment?

I would recommend using Conditional routing as dchiesa1 mentioned where you can have multiple targets you can route traffic to depending on condition of your choice. It goes into ProxyEndpoint  flow. 

<RouteRule name="Route1">
 
<Condition>.....</Condition>
 
<TargetEndpoint>TargetEndpoint1</TargetEndpoint>
</RouteRule>
<RouteRule name="Route2"> 
<Condition>.....</Condition>

 
<TargetEndpoint>TargetEndpoint2</TargetEndpoint>
</RouteRule>