Java 如何在Spring boot应用程序属性中动态获取aws memcached配置终结点

Java 如何在Spring boot应用程序属性中动态获取aws memcached配置终结点,java,amazon-web-services,spring-boot,memcached,terraform,Java,Amazon Web Services,Spring Boot,Memcached,Terraform,我正在使用terraform脚本创建AWS资源。使用AWS ElastiCached memcached缓存某些数据 output "configuration_endpoint" { value = "${aws_elasticache_cluster.memcache.configuration_endpoint}" } 我想将memcached配置端点动态配置到spring boot application.properties文件中,而不是硬编码。 目前的情况如下 memcache

我正在使用terraform脚本创建AWS资源。使用AWS ElastiCached memcached缓存某些数据

output "configuration_endpoint" {
  value = "${aws_elasticache_cluster.memcache.configuration_endpoint}"
}
我想将memcached配置端点动态配置到spring boot application.properties文件中,而不是硬编码。 目前的情况如下

memcached.addresses=xyz.cache.amazonaws.com:11211

我在网上找不到任何好的参考资料。在aws中创建资源后,是否有任何方法可以动态设置此设置。我使用Jenkins运行这个terraform脚本,并将springboot应用程序部署到AWS中。

通过SSM参数存储如何?好的,让我检查一下如何使用它!谢谢你是如何运行你的应用程序的?在EC2实例上?作为ECS服务?作为Kubernetes服务?在ElasticBeanstalk上?将其作为ECS服务运行。