Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

AWS Amplify to talk to rest api in ec2 created in elastic beanstalk

Writer Emily Wong

I've just used AWS Amplify to create my react frontend and AppSync API which is nice. I have a spring batch project that I've deployed to ec2 using elastic beanstalk and codepipeline which works fine.

I can also call the REST endpoints on postman but the problem is how do I programmatically update the API endpoint URL in my frontend project given that I do terminate and re-create the elastic beanstalk environment on a daily basis?

3

1 Answer

Based on the comments.

You sadly can't add ssl to myrestapi.ap-southeast-2.elasticbeanstalk.com. The reason is that this is domain controlled by AWS. You can only request SSL certificates for domains that you control (i.e. own):

Before ACM issues a certificate, it validates that you own or control the domain names in your certificate request. You can use either email validation or DNS validation.

Thus if you want to have ssl for your EB, you need to have your own domain. You can get one from Route53:

If you are constantly changing your EB, its URL will be changing as well. Thus you would need to setup some automation procedure to update the record set in Route53 to new url. There are examples for that, though they would need to be adapted specifically to your use-case:

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.