spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

ParameterStore: updated values in SSM parameter store are not propagated to spring application

Open miloszpiglas opened this issue 1 year ago • 2 comments

Type: Bug

Component: Parameter Store

Describe the bug Updated values in AWS parameter store are not propagated to running application.

How to reproduce

  1. Start sample application (https://github.com/miloszpiglas/spring-demo-ssm)
  2. Change value of "/config/message" in SSM.
  3. Observe logs from https://github.com/miloszpiglas/spring-demo-ssm/blob/013a255a544fcdf3ac976627932cf7c9a0ce4be5/src/main/java/com/example/demo/MyConfig.java#L17

Changes in SSM are detected but MyConfig.message is updated with old value. I believe it is cause by implementation of method io.awspring.cloud.autoconfigure.config.reload.PollingAwsPropertySourceChangeDetector.executeCycle(). New values are only loaded in local copy of ParameterStorePropertySource however environment is updated with values that were loaded during application start.

Sample Sample application https://github.com/miloszpiglas/spring-demo-ssm

miloszpiglas avatar Dec 22 '23 12:12 miloszpiglas

Hi guys, I've the same issue. Any update on this?

Update: The reload work normally in my app after I explicit declare "strategy: refresh". I though i was set by default

thanhlong1543 avatar Feb 21 '24 15:02 thanhlong1543

@miloszpiglas in your sample you're binding configuration properties without a prefix. I think this may be a problem.

I made a fully working sample where reload works as expected: https://github.com/maciej-scratches/spring-cloud-aws-gh-1003

maciejwalkowiak avatar Mar 03 '24 22:03 maciejwalkowiak