Skip to main content

Spring Profiles

To provide better flexibility and modularity, xpanse extensively uses spring profiles for different parts of the application. Each profile either enables a certain functionality or provides some default configuration.

profile nameforbidden for prodDescription
nouthYesto disable any auth for APIs.
oauthNoto enable oauth based auth for APIs.
zitadelNoto use Zitadel as oauth provider.
zitadel-testbedYesto use test instance of Zitadel.
zitadel-localYesto use local instance of Zitadel.
tofu-makerNoto use remote instance of OpenTofu for deployment.
terra-bootNoto use remote instance of Terraform for deployment.
local-docker-stackYesto be used when local docker containers of all xpanse components.
devYesto be used in all local development environments.
opentelemetryNoto enable OTEL instrumentation and forwarding.
mysqlNoto enable MySQL database as persistence layer.
testYesUsed in tests for having dummy configuration values.
agent-apiNoUsed when we want to deploy only the agent APIs. This is used for generating agent API schema and also to scale agent APIs independently.
generate-openapi-docYesUsed only to generate API documentation for swagger-hub.

Configuration Properties

All profiles and the configuration properties that are part of it can be found at this place. Configuration values can be overridden with methods supported by Spring framework as described here.

Activating Profiles

Spring provides multiple ways to activate profiles. The list of profile names which we intend to activate can be passed as

  1. VM argument.
  2. Program argument.
  3. Environment variable.
# VM argument
java -Dspring.profiles.active=profile1,profile2 -jar xpanse-runtime-*-SNAPSHOT.jar
# Program argument
java -jar xpanse-runtime-*-SNAPSHOT.jar --spring.profiles.active=profile1,profile2
# Environment variable
export SPRING_PROFILE_ACTIVE=profile1,profile2