Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for spring.config.import with S3 backend #161

Closed
celcius112 opened this issue Jul 8, 2021 · 8 comments · Fixed by #849
Closed

Add support for spring.config.import with S3 backend #161

celcius112 opened this issue Jul 8, 2021 · 8 comments · Fixed by #849
Labels
component: s3 S3 integration related issue type: feature Integration with a new AWS service or bigger change in existing integration
Milestone

Comments

@celcius112
Copy link

Type: Feature

First of all, as a disclaimer, I am not sure whether this feature request should be in this repo or in https://github.com/spring-cloud/spring-cloud-config, as there is already a S3 implementation for the legacy bootstrap.

Similar to the parameter store and secrets manager configuration, it would be great if AWS S3 could be used as external configuration backend, such as:

spring:
  config:
    import: aws-s3:my-bucket

At the moment, spring-cloud-config does not seem to propose Spring Boot's spring.config.import property for S3. Since using spring.config.import with parameter-store-config and secrets-manager-config
simultaneously with the legacy bootstrap with s3 does not seem to work out of the box (AwsSecretsManagerPropertySourceLocator and AwsSecretsManagerConfigDataLocationResolver are both created simultaneously), it is at the moment a blocking point for us for migrating to the new spring.config.import and correcting #159.

@github-actions github-actions bot added type: enhancement Smaller enhancement in existing integration status: waiting-for-triage Team has not yet looked into this issue labels Jul 8, 2021
@MatejNedic
Copy link
Member

MatejNedic commented Jul 9, 2021

Hey @celcius112 ,
S3 module currently doesn't support spring.config.import .
Could you please explain in greater detail what would you expect from this feature to support?

@celcius112
Copy link
Author

Hello @MatejNedic,

At the moment, spring-cloud-config-server proposes a S3 module that retrieves .properties, .yml or .json files from a S3 bucket. Using the legacy bootstrap the properties are imported into the application environment.

I have implemented what spring-cloud-config-server proposes, but using Spring Boot's spring.config.import:

spring:
  config:
    import:
      - aws-s3:bucket-name-1;file1.yml
      - aws-s3:bucket-name-1;file2.yml

I don't think this module should have much more functionality than that, except maybe having a way to override the S3Client using the BootstrapContext.

I guess the usage would be similar to spring-cloud-aws's parameter-store and secrets-manager starters.

@MatejNedic MatejNedic added component: s3 S3 integration related issue type: feature Integration with a new AWS service or bigger change in existing integration and removed status: waiting-for-triage Team has not yet looked into this issue type: enhancement Smaller enhancement in existing integration labels Jul 10, 2021
@maciejwalkowiak maciejwalkowiak added status: team-discussion Team has to figure out how to proceed status: ideal-for-contribution We agree it's nice to have but it is not team priority and removed status: team-discussion Team has to figure out how to proceed labels Jul 18, 2021
@maciejwalkowiak maciejwalkowiak added this to the 3.x milestone Apr 2, 2022
@kunalvarpe
Copy link
Contributor

@maciejwalkowiak @MatejNedic,
I would like to contribute here, I have done some changes in my local. Before pushing that I have some queries/doubts.

  • As per above comment the expectation is spring confing import should load properties from file.yml and file2.yml from the given buckets.
  • What if file has profile mentioned with it, in such situation should we respet the profile as well.
    e.g.
spring:
  config:
    import:
     - aws-s3:bucket-name-1;file1-test.yml
     - aws-s3:bucket-name-1;file2.yml
     - aws-s3:bucket-name-2;file3-integration.yml
  • What would be other usecases here?

@maciejwalkowiak
Copy link
Contributor

@kunalvarpe good question. It should be consistent with other property sources, for example - if you use spring.config.import with a filesystem location, does it respect profiles? It should work the same with S3 location.

@kunalvarpe
Copy link
Contributor

Hi @maciejwalkowiak I have push the initial commit to the PR #849. Could you please let me know if I am doing the changes in correct direction, also I would be needed some more guidence on respecting the profiles support.

MatejNedic added a commit to MatejNedic/spring-cloud-aws-1 that referenced this issue Mar 13, 2024
@maciejwalkowiak maciejwalkowiak modified the milestones: 3.x, 3.2.0 M1 Mar 15, 2024
@maciejwalkowiak maciejwalkowiak removed the status: ideal-for-contribution We agree it's nice to have but it is not team priority label Mar 15, 2024
@maciejwalkowiak maciejwalkowiak modified the milestones: 3.2.0 M1, 3.2.0 M2 Mar 29, 2024
@vishal94136
Copy link

Hello @MatejNedic,

At the moment, spring-cloud-config-server proposes a S3 module that retrieves .properties, .yml or .json files from a S3 bucket. Using the legacy bootstrap the properties are imported into the application environment.

I have implemented what spring-cloud-config-server proposes, but using Spring Boot's spring.config.import:

spring:
  config:
    import:
      - aws-s3:bucket-name-1;file1.yml
      - aws-s3:bucket-name-1;file2.yml

I don't think this module should have much more functionality than that, except maybe having a way to override the S3Client using the BootstrapContext.

I guess the usage would be similar to spring-cloud-aws's parameter-store and secrets-manager starters.

is it possible to have aws s3 config server without legacy bootstrap?

@maciejwalkowiak
Copy link
Contributor

@vishal94136 we have S3 spring.config.import in progress here: #849. It will be included in 3.2.0. Spring Boot's "bootstrap" phase is not legacy - this is the new way of handling such things. What's legacy is using Spring Cloud Bootstrap 🙃

@vishal94136
Copy link

@maciejwalkowiak thanks a lot for replying and sorry I sentenced it wrong I meant the spring cloud bootstrap.

@maciejwalkowiak maciejwalkowiak modified the milestones: 3.2.0 M2, 3.3.x Sep 16, 2024
MatejNedic added a commit to MatejNedic/spring-cloud-aws-1 that referenced this issue Sep 23, 2024
# Conflicts:
#	spring-cloud-aws-dependencies/pom.xml
#	spring-cloud-aws-modulith/pom.xml
#	spring-cloud-aws-s3-parent/spring-cloud-aws-s3-cross-region-client/src/main/java/io/awspring/cloud/s3/crossregion/AbstractCrossRegionS3Client.java
MatejNedic added a commit to MatejNedic/spring-cloud-aws-1 that referenced this issue Dec 8, 2024
# Conflicts:
#	docs/src/main/asciidoc/s3.adoc
#	spring-cloud-aws-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
MatejNedic added a commit to MatejNedic/spring-cloud-aws-1 that referenced this issue Dec 8, 2024
# Conflicts:
#	spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/properties/S3Properties.java
MatejNedic added a commit to kunalvarpe/spring-cloud-aws that referenced this issue Dec 8, 2024
# Conflicts:
#	spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/properties/S3Properties.java
@maciejwalkowiak maciejwalkowiak modified the milestones: 3.3.x, 3.3.0 M2 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue type: feature Integration with a new AWS service or bigger change in existing integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants