Open kieranjen opened 3 years ago
Seems to be related to AWSParameterStoreConfiguration
where it extends AWSClientConfiguration
from aws sdk v1 lib which is by nature not compatible with native image.
There is a PR waiting on @sdelamo https://github.com/micronaut-projects/micronaut-aws/pull/1060
Per https://arnoldgalovics.com/tackling-java-cold-startup-times-on-aws-lambda-with-graalvm/, I was finally able to fix the issue by adding below files under src/main/graal
resource-config.json
{
"resources": [
{
"pattern": "com/amazonaws/internal/config/awssdk_config_default.json"
},
{
"pattern": "com/amazonaws/partitions/endpoints.json"
},
{
"pattern": "com/amazonaws/sdk/versionInfo.properties"
}
]
}
reflect.json
[
{
"name": "com.amazonaws.internal.config.InternalConfigJsonHelper",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.SignerConfig",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.SignerConfigJsonHelper",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.HttpClientConfig",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.HttpClientConfigJsonHelper",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.HostRegexToRegionMappingJsonHelper",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
},
{
"name": "com.amazonaws.internal.config.JsonIndex",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredClasses": true
}
]
@ilopmar maybe we should include the above config until the PR @sdelamo has assigned to him is dealt with?
We do have support for ParameterStore but using SDK v2 (which includes it out of the box). This is our test application: https://github.com/micronaut-graal-tests/micronaut-aws-sdk2-graal/tree/2.5.x_paramstore
So what is #1060 for?
@sdelamo can confirm it but I think that PR adds support for use Parameter Store as a Distributed Config provider in Micronaut.
@sdelamo can this be closed since in Micronaut 3 it now uses the v2 SDK?
I am trying to use the parameter store feature explained in the documentation here. When building the application as a native image and trying to run on AWS Lambda, I get an error on startup.
Task List
Steps to Reproduce
./gradlew buildNativeLambda
/config/application/example/awsTest
with any value e.g.Test
Expected Behaviour
When the application starts it should pick up the configuration from the SSM parameter store and print and return it from the API call.
Actual Behaviour
The following exception is raised when the application is starting up:
Environment Information
Example Application
https://github.com/kieranjen/micronaut-graal-ssm-params