title: Micronaut FunctionInitializer override application properties
body: <pre class="lang-java prettyprint-override"><code>@Singleton
  public class TestFunction extends FunctionInitializer {
      Logger log = LoggerFactory.getLogger(TestFunction.class);
  
      public TestFunction() {
      }
  
      public String execute() {
          return &quot;Hello&quot;;
      }
  
  }
  </code></pre>
  <p>I want to override datasource properties in application.yml file programmatically, but without using bean created event listener. Is there a way to do that. Like creating a custom application context with properties.</p>
  <p>I have used the below approach for Micronaut API gateway proxy.</p>
  <pre class="lang-java prettyprint-override"><code>public class StreamLambdaHandler implements RequestStreamHandler {
  .......
  public StreamLambdaHandler() {
          try {
              log.info(&quot;Initializing Lambda Container&quot;);
              this.dbCredentialService = new DBCredentialService();
              // Get updated database credential map
              Map&lt;String, Object&gt; props = this.dbCredentialService.getDbCredential();
              // Create application context builder with updated properties
              // i.e Override datasources properties in application.yml
              builder = ApplicationContext.build().properties(props);
              handler = new MicronautLambdaContainerHandler(builder);
        }....
      ........
  }
  </code></pre>
  <p>Can we do something similar with FunctionInitializer?</p>