Getting new API ID and automatically inserting it in React application to make requests

I want to automate deployment of my full stack: a react single page front end served from s3 with a serverless, lambda + api gateway + dynamodb etc.

I want to avoid having to manually enter the new api id in each of the react files after initial back end deployment.

Is there an existing service/ standard pipe line for achieving this or will I need to write a little program myself?

I am agnostic regarding whether to use http or rest api, so if there is a simpler solution using either option, that would be preferable.

Thanks!