micronaut-projects / micronaut-aws

Projects specific to integrating Micronaut and Amazon Web Services (AWS)
Apache License 2.0
82 stars 81 forks source link

Load the Lambda Configurations from SSM #2148

Closed RajeevMasseyTR closed 5 days ago

RajeevMasseyTR commented 1 week ago

Issue description

As per the documentation for https://docs.micronaut.io/latest/guide/#distributedConfigurationAwsParameterStore

What was notice when executing the lambda with

micronaut:
  config-client:
    enabled: true

aws:
  distributed-configuration:
    search-common-application: false
    search-active-environments: false
  client:
    system-manager:
      parameterstore:
        enabled: true
        rootHierarchyPath: "/proc/config"

and whenMICRONAUT_ENVIRONMENTS=lambda it is not loading the configurations from /proc/config/application/param1 path in ssm

the logs :


{"timestamp":"2024-06-20 15:22:20.481","level":"INFO","thread":"Test worker","logger":"io.micronaut.context.DefaultApplicationContext$RuntimeConfiguredEnvironment","message":"Established active environments: [lambda, test, function]","context":"default"}
{"timestamp":"2024-06-20 15:24:13.154","level":"INFO","thread":"Test worker","logger":"io.micronaut.context.DefaultApplicationContext$BootstrapEnvironment","message":"Established active environments: [lambda, test, function]","context":"default"}
{"timestamp":"2024-06-20 15:24:13.384","level":"INFO","thread":"Test worker","logger":"io.micronaut.context.DefaultBeanContext","message":"Reading bootstrap environment configuration","context":"default"}
{"timestamp":"2024-06-20 15:24:13.571","level":"DEBUG","thread":"Test worker","logger":"io.micronaut.discovery.client.config.DistributedPropertySourceLocator","message":"Resolving configuration sources from client: compositeConfigurationClient()","context":"default"}
{"timestamp":"2024-06-20 15:24:13.918","level":"INFO","thread":"Test worker","logger":"io.micronaut.discovery.client.config.DistributedPropertySourceLocator","message":"Resolved 0 configuration sources from client: compositeConfigurationClient()","context":"default"}
{"timestamp":"2024-06-20 15:24:26.417","level":"TRACE","thread":"Test worker","logger":"io.micronaut.aws.sdk.v2.service.AwsClientFactory","message":"Setting User-Agent for AWS SDK to micronaut/4.1.9","context":"default"}
{"timestamp":"2024-06-20 15:24:28.311","level":"TRACE","thread":"Test worker","logger":"io.micronaut.aws.sdk.v2.service.AwsClientFactory","message":"Setting User-Agent for AWS SDK to micronaut/4.1.9","context":"default"}
{"timestamp":"2024-06-20 15:24:46.753","level":"TRACE","thread":"Test worker","logger":"io.micronaut.aws.sdk.v2.service.AwsClientFactory","message":"Setting User-Agent for AWS SDK to micronaut/4.1.9","context":"default"}
{"timestamp":"2024-06-20 15:24:46.770","level":"TRACE","thread":"Test worker","logger":"io.micronaut.aws.sdk.v2.service.AwsClientFactory","message":"Setting User-Agent for AWS SDK to micronaut/4.1.9","context":"default"}
{"timestamp":"2024-06-20 15:24:50.476","level":"INFO","thread":"Test worker","logger":"com.reuters.rpc.ReferenceDataRefreshRequestHandler","message":"Activating reference data refreshing with MICRONAUT_ENVIRONMENTS as lambda","context":"default"}

after this it fails due to bean inititlization failure because param1 is not injected from SSM