2

Currently, I'm polling after a fixed interval of time for fetching configurations from AWS AppConfig using getconfiguration API of aws-sdk for javascript. But, I want to fetch configurations only if there is any change in configurations at AWS AppConfig so that I can hit rest endpoint to get the latest updated configurations from AWS AppConfig.

If there is any way to get this done, please suggest. Also, if it is not feasible then, any official documentation of AWS which describe it will also work.

  • Maybe increase the frequency of the pooling or the lambda function will help, not sure. But I'm keen to know the answer. – Abhimanyu Dwivedi Jun 30 '21 at 09:37
  • 2
    @AbhimanyuDwivedi We can optimize our polling strategy by maintaining ClientConfigurationVersion in cache as whenever we pass ClientConfigurationVersion in params while invoking getConfiguration API then, it will not incur any charge if there is no change in configurations. For more details, refer https://workshop.aws-management.tools/appconfig/best-practices/ – Nandishwar Garg Jun 30 '21 at 10:45

1 Answers1

3

As per the AWS documentation about appconfig,

You must configure your application to periodically check for and receive configuration updates by using the GetConfiguration API action. When a new or updated configuration is ready, AWS AppConfig deploys the configuration file to each target in your deployment strategy.

So, there is no way to configure a trigger in AWS which lets you know that App Config has changed. You must do it periodically.

AWS Doc link

AWS doc screenshot for checking and receiving config data

ankush__
  • 141
  • 9
  • Sharing this gist here as an example on how to poll a AppConfig for changes with Javascript. https://gist.github.com/maylonpedroso/c8fe95d836617e85fdb4742e2042d1d5 This has not been tested in an actual application and is probably not ready for prod but should serve as a starting point to develop your own. – maylon Mar 11 '22 at 21:40