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 ability to override AWS endpoints during configuration discovery. #2277

Open
wants to merge 1 commit into
base: 4.9.x
Choose a base branch
from

Conversation

ammeek
Copy link

@ammeek ammeek commented Jan 14, 2025

Currently, it is not possible to override the AWS SSM/ secret manager endpoint during configuration discovery. This stops you from being able to integrate Localstack during the configuration discovery process.

I've added the BootstrapContextCompatible annotation to the AWSServiceConfigurationProperties class to resolve this.
I've also added a test to check that this annotation has been added as I have seen similar tests throughout the project.
I am not sure if additional testing showing the configuration discovery process integrating with Localstack is required.

…tible to support configuration discovery via Localstack.
@CLAassistant
Copy link

CLAassistant commented Jan 14, 2025

CLA assistant check
All committers have signed the CLA.

@ammeek ammeek changed the title Add ability to override AWS endpoint for configuration discovery. Add ability to override AWS endpoints during configuration discovery. Jan 15, 2025
@ammeek ammeek marked this pull request as ready for review January 15, 2025 07:47
@ammeek ammeek changed the base branch from 4.7.x to 4.8.x January 15, 2025 07:56
@ammeek ammeek changed the base branch from 4.8.x to 4.9.x January 21, 2025 22:37
@sdelamo
Copy link
Contributor

sdelamo commented Mar 19, 2025

@ammeek I am not sure we need this pull-request. I think you can create a BeanCreatedEventListener for the different builders builder.

e.g

@Singleton
public class S3ClientBuilderCustomizer implements BeanCreatedEventListener<S3ClientBuilder> {

    @Override
    public S3ClientBuilder onCreated(@NonNull BeanCreatedEvent<S3ClientBuilder> event) {
        return event.getBean()
            .overrideConfiguration(c -> c.apiCallTimeout(Duration.of(60, ChronoUnit.SECONDS)));
    }
}

@ammeek
Copy link
Author

ammeek commented Mar 20, 2025

Thanks for your reply @sdelamo unfortunately, the bootstrap context disallows bean event listeners.

I would like to be able to continue to use the established convention for overriding AWS endpoints in Micronaut which is done via the AWSServiceConfigurationProperties class. This PR will allow that class to be available during configuration discovery via the bootstrap context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants