In aws_api_gateway_integration, how to get "rest_api_id" for an existing API on gateway

I have written terraform script to provision a lambda function successfully. This lambda function will be triggered when an API is called. I am not provisioning that Api using terraform. That API already exists in AWS. in the aws_api_gateway_integration block how to get the value of “rest_api_id” for an API which already exists. I haven’t provisiioned that API using terraform.

 resource "aws_api_gateway_integration" "MyDemoIntegration" {

        rest_api_id =  ???

       resource_id =  ???

       integration_http_method =  "DELETE"

       type =  "AWS_PROXY"

       uri =

      authorization  = "COGNITO_USER_POOLS"

If I am provisioning that API, I can get the rest_api_id like this. But I am not writing terraform script to provision that API. It is already existing API deployed thru Cloudformation. I need get that id of that API.  How can get id of the api ?
            resource "aws_api_gateway_integration" "MyDemoIntegration"{
                     rest_api_id =


Thank You

Importing API resource in the terraform and then using output to get the id might help here

Thank YOu
I was able to use data block and did the job fine