We have two spring boot applications which is accessing dax cluster using the software.amazon.dax:amazon-dax-client java client.
This is how I am building the dax client. Using the cluster URL. I have created the dax cluster through cloudformation. After the cluster is created, I get the dax endpoint and update it in the code.
ClusterDaxClient.builder().overrideConfiguration(
Configuration.builder().region(Region.EU_CENTRAL_1)
.URL("dax://datatesting-proc.infqpgtest.dax-clusters.eu-central-1.amazonaws.com").build()
).build();
If I change the node type of the cluster in cloud formation, the endpoint gets changed. Then I need to update the hard-coded endpoint across all the apps accessing DAX.
Initially, I had added the cluster name in cloud formation. But it's not possible to change the node type with this configuration.
Is there any way I can update the node type of DAX without affecting the applications? The ideal way would've been when I update the node type in cloudformation, AWS creates a new node with the same endpoint, and deletes the old dax cluster. However, this is clearly not the case.
Also, how do I make the DAX work without hardcoding the URL? Is there any parameter that I can set both in cloud formation file and my application code?