Skip to content

[Enhancement] SSM get parameter taking too long to retrieve a parameter. #181

Closed
@luismospinam

Description

@luismospinam

Hello, is it normal that a simple code to get a simple SSM parameter takes over 10 seconds?

  @Override
  public String handleRequest(Object o, Context context) {
    LambdaLogger logger = context.getLogger();

    Instant start = Instant.now();
    SSMProvider ssmProvider = ParamManager.getSsmProvider();
    String ssmParameter = ssmProvider.withDecryption().get("test-parameter");
    logger.log("ssm parameter: " + ssmParameter);
    Instant finish = Instant.now();
    logger.log("Total duration SSM: " + Duration.between(start, finish).toMillis());

    return ssmParameter;
 }

Similar code to pull a parameter from SSM takes less than a second in other languages using AWS SDK, for instance, NodeJs.

Is this a normal java behavior?

Notes:

  • This issue is not related to the withDecryption() functionality, even without it the code takes the same amount of time.
  • This is not related to Java cold start (using Lambda), a simple "Hello World" application takes less than a second to execute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions