Variable substitution in App Engine 11 app.yaml

130 views
Skip to first unread message

Tom Harris

unread,
Oct 11, 2021, 9:45:39 AM10/11/21
to google-a...@googlegroups.com

We've got several App Engine projects that I am migrating from App Engine 8 to App Engine 11 on Spring Boot. A number of them use a vpc-access-connector in their appengine-web.xml file, which we inject using resource filtering in the maven-war-plugin. The new way to configure the app engine is to use a `src/main/appengine/app.yaml` file and a jar instead of a war, as the artifact however I have been unable to determine how to do variable substitution into the app.yaml file.

I need to inject different values based on the maven profile being run. We currently define vpc access connector values in maven properties sections within profiles aligned with our spring profiles for each of our deployment environments, like test, ea and prod.

What is the solution here?

Is there some way to use different app.yaml files based on which profile is being invoked? (This is not the best solution, as it would mean most of the file content would be static copies, though the common stuff could be moved to an included yaml.)

Or is there some syntax I can't locate online that will allow me to set an environment variable or maven property and refer to it from within the `src/main/appengine/app.yaml` file?

Thanks for any assistance!
Tom Harris

Ludovic Champenois

unread,
Oct 18, 2021, 10:58:13 AM10/18/21
to Google App Engine
src/main/appengine/app.yaml is indeed the configuration for pure Java11 apps, bundling your web server...
You can now also use the beta Java11 runtime with GAE bundled apis, the same way as Java8 with appengine-web.xml as seen in


If you still want to use app.yaml, you'll need to configure the Maven resources filtering plugin https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html with the correct settings so it can handle app.yaml files.

Ludo

Reply all
Reply to author
Forward
0 new messages