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 JSON Configurations from SSM #2145

Open RajeevMasseyTR opened 1 week ago

RajeevMasseyTR commented 1 week ago

Issue description

At present Micronaut supports loading configuration from the SSM as showcased here https://guides.micronaut.io/latest/micronaut-aws-parameter-store-gradle-java.html

Now since there are 100's of configurations distributed what we want is we have a JSON stored in SSM at path /config with all the configurations

e.g

{
"MCA_DOWNSTREAM_URL" : "<Some URL>",
"MCA_DOWNSTREAM_TIMEZONE" : "<Some Timezone>"
}
@ConfigurationProperties(Configurations.PREFIX)
public record Configurations(String url, String timezone) {

    public static final String PREFIX = "mca.downstream";
}

is there a way where we can load configuration from JSON in a SSM parameter store? and if not is there a work around?

graemerocher commented 1 week ago

not currently to my knowledge but it could be implemented, this is supported with consul if I recall

RajeevMasseyTR commented 1 week ago

So there is no work around

RajeevMasseyTR commented 1 week ago

Hey @graemerocher can we do something like result = serde.readValue(ssm, COnfig.class); and load the configurations ?

graemerocher commented 1 week ago

Something like https://github.com/micronaut-projects/micronaut-discovery-client/blob/4.4.x/discovery-client/src/main/java/io/micronaut/discovery/consul/config/ConsulConfigurationClient.java#L192 needs implementing for SSM