My KMSClient
is being instantiated way before LocalStack is started and I don't know how I should initialise my KmsClientBuilder
to override the endpoint.
KmsClient.builder().endpointOverride("some sort of static value")).build();
LocalStackContainer = new LocalStackContainer(DockerImageName.parse("localstack/localstack:2.3.0").withServices(LocalStackContainer.Service.KMS)
You should instantiate the LocalStack container first before trying to create a KMS client.
Then as per docs, you need to instantiate your client(s) with the right:
For KMS (and other clients), this should work: