I am getting below error : Unable to execute HTTP request: Connect to secretsmanager.eu-central-1.amazonaws.com:443 [secretsmanager.eu-central-1.amazonaws.com/ipadress, secretsmanager.eu-central-1.amazonaws.com/ipadress] failed: connect timed out", "errorType": "software.amazon.awssdk.core.exception.SdkClientException"
Fetch the custom properties from AWS secret manager which is located under secret name: /config/micronautguide/details and encryption by using aws/secretmanager and created key/value pair as: menuEventTest: testingData
I have a micronaut application which is executed by AWS lambda function. Below are the code details:
bootstrap.yml
micronaut:
config-client:
enabled: true
application:
name: micronautguide
aws:
secretsmanager:
secrets:
- secret-name: /config/micronautguide/details
application.yml
menuEventTest: ${menuEventTest}
MicronautCode:
public class FunctionRequestHandler extends MicronautRequestHandler<Object, Object> {
private static final Logger LOG = LoggerFactory.getLogger(FunctionRequestHandler.class);
@Value("${menuEventTest}")
private String menuEventTest;
@Override
public Object execute(Object payload) {
LOG.info("Request menuEvent: {} ", menuEventTest);
}
I followed the link: micronaut aws configuration
Required Dependencies:
implementation("io.micronaut.aws:micronaut-aws-secretsmanager")
implementation("io.micronaut.aws:micronaut-function-aws")
how to fetch the properties from secret manager for micronaut application.