Is it absolutely necessary to explicitely mention region while building SsmClient using aws sdk for java v2?

319 views Asked by At

So basically I want to know what will if we don't mention the region or if mention the region incorrectly

SsmClient ssmClient = SsmClient.builder()
                .region(region)
                .build();

I was expecting that if region is not set then it should not throw any error and will search all regions for the ssm parameter

1

There are 1 answers

0
Mark B On BEST ANSWER

It's not necessary if you have the region set somewhere else, like in an environment variable. You have to specify a region somehow though. The AWS SDK does not search all regions automatically when you try to reference a resource without a region specified.