We are trying to migrate our Spring Cloud Config Server from a Git Backend to S3. This is working fine for the normal configuration yaml files, but we also use it to serve plain text files and are having problems getting that working.
This is documented here https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#spring-cloud-config-serving-plain-text-aws-s3, but its not clear what URL format to use.
With Git we used
https://config-host/a/b/master/myfile.txt
For S3 I've tried
https://config-host/test/b/c/myfile.txt
which results in this in the logs
2021-07-30 17:46:35.787 WARN 1 --- [ XNIO-1 task-3] o.s.c.config.server.support.PathUtils : Resource path "https://s3.us-west-2.amazonaws.com/my-bucket/test" was successfully resolved but resource "https://s3.us-west-2.amazonaws.com/my-bucket/test%2Fmyfile.txt" is neither under the current location "https://s3.us-west-2.amazonaws.com/my-bucket/test" nor under any of the allowed locations [Amazon s3 resource [bucket='my-bucket' and object='test']]
(after putting myfile.txt in the test folder in my-bucket)
Possibly there is an issue with the encoding here - ie test%2Fmyfile.txt?
We are using spring-cloud 2020.0.3 and spring-cloud-aws 2.3.0
Originally raised on stack overflow https://stackoverflow.com/questions/68595665/serving-plain-text-files-from-spring-cloud-config-server-with-s3-backend
Comment From: ithinkisam
I'm also hoping to move away from Git to S3 (we're migrating our config server from on-prem to AWS).
This Spring Cloud Config reference guide suggests that serving plain text via AWS S3 is possible, but the "additional endpoint" of /{application}/{profile}/{label}/{path} described here does not appear to work with the S3 backend and results in a 404.
Comment From: ryanjbaxter
Could you try with 2021.0.3?
Comment From: ryanjbaxter
@hpoettker it appears you may have looked into this issue, is this only possible now with the AWS v2 SDK?
Comment From: ryanjbaxter
Duplicates https://github.com/spring-cloud/spring-cloud-config/issues/2216