How can I route traffic depending on setting from parameter store.
Hi, I'm looking to see what options are available and what might be the best practice to accomplish routing HTTP traffic based on a parameter within the parameter store.
Currently we have multiple services all sending HTTP traffic to a single URL. This receiving endpoint is about to be duplicated and we will be introducing a setting in the parameter store that will determine whether traffic will be send to endpoint A, or endpoint B.
A lambda function is always an option, but I'm looking to see if there's anything already within the managed services side of AWS that can help us. At first ALB seemed a logical choice as that has routing rules, unfortunately it seems the rules can only be determined by attributes of the incoming request, and not a Parameter from the parameter store.
So perhaps API gateway could be utilised, but with around a million requests per day, I'm concerned this would be costly and it's also not clear whether I forward traffic based on a setting from the parameter store.
Any thoughts appreciated, thanks!
There is not a single AWS Service that will respond to changes in the values of SSM parameters. Usually values of SSM parameters are considered infrastructure. So the values of these parameters usually come from CloudFormation templates (or terraform modules). The purpose of these parameters is often their use as defaults for the parameters in other CloudFormation templates.
That being said: The routing change can be easily modelled as an infrastructure change. If you setup your infrastructure as CloudFormation template to use an SSM parameter (this can be done in 2 ways, input parameter default or a dynamic reference). The internals of the CloudFormation template could arrange the proper routing. Deploying the template would use the value of the parameter, but if the parameter changes you need to redeploy the template (making sure you will use the latest value of the SSM parameter).
This could be automated if you set up an EventBridge rule to listen for changes to the parameter in question. The rule could then trigger a lambda. The lambda could then take care of redeploying the unchanged template.
Documentation can be found here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html
Relevant questions
Routing internal and external traffic using the same public subdomain name
asked 5 months agoHow do I set up Amazon VPC ingress routing with a stateless network appliance?
Accepted Answerasked 2 years agoHow do I configure VPC route tables for Traffic Mirroring?
Accepted Answerasked 2 years agoWhat is the best practice to load data to redshift with aws glue ?
asked 2 years agoWhich AWS load balancer type is the best for directing geographically different traffic to the nearest server?
asked 6 months agoHow can I route traffic depending on setting from parameter store.
asked a month agoRouting VPC to VPC traffic through an on-prem firewall via Transit Gateway
Accepted Answerasked a year agoAmazon Route 53 weighted routing "stickiness"
Accepted Answerasked 2 years agoHow can I route OpenVPN traffic
Accepted Answerasked 24 days agoBest practices for securing service to service REST communication in a microservices architecture
Accepted Answerasked 2 years ago