Closed patelhpr closed 1 year ago
@patelhpr you can try using the cdk --outputs-file parameter to get the output in json file when using 'cdk deploy' . It will give you RestAPI in JSON and later you can use the same for your frontend deployment.
You were very close! This works:
rest_api_id = self.chalice.get_resource("RestAPI").get_att("RestApiId").to_string()
Hi,
I am developing a rest api using Chalice, and I have to use that api in the frontend of a web application. I need that rest api id and domain to pass it on to my frontend as an environment variable when I create my infrastructure. I am using CDK to create rest of the infrastructure as well. I was wondering if there is any way I can extract that from the CDK.
I tried doing something like this but it only gives a CDK Reference object and not the actual rest api id.
rest_api_id = self.chalice.get_resource("RestAPI").get_att("RestApiId")
Any help would be appreciated,
Thanks in Advance