Issue Description:
I'm trying to access configuration files located inside a folder in an S3 bucket using Spring Cloud Config. Below is the folder structure in S3:
bucket1/
└── config/
└── application-dev.yml
Here is the relevant Spring configuration:
spring:
profiles:
active: awss3
cloud:
config:
server:
awss3:
region: us-east-1
bucket: bucket1/config
When trying to access the configuration via http://localhost:8888/application/dev, I am encountering an issue. The debug logs indicate that the S3 key was not found. The encoded URL appears as /bucket1%2Fconfig/application-dev.yml, and it seems like the folder structure or path encoding might be the cause.
Debug Log Excerpt:
Key not found: /bucket1%2Fconfig/application-dev.yml
Question:
How can I resolve this issue to correctly access the application-dev.yml file from the config folder in the S3 bucket?
(or)
Support for subfolders in a S3 bucket is not available ?
Package versions:
spring-cloud-config-server - 4.1.3 software.amazon.awssdk (s3) - 2.28.1
Any help or suggestions would be appreciated!
Comment From: ryanjbaxter
According to the S3 docs...
Bucket names can consist only of lowercase letters, numbers, dots (.), and hyphens (-).
Comment From: BeardDude
True. The bucket name is bucket1 and the sub-folder name is config inside which i have the application-dev.yml file.
Is there any way to access the application-dev.yml file ?
Comment From: ryanjbaxter
Yes there is an example in the integration test we have https://github.com/spring-cloud/spring-cloud-config/blob/main/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/AwsS3IntegrationTests.java#L94-L95
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.