I couldn't understand from the api reference what is the real difference between these two classes: CfnRestApi and RestApi in cdk.
As I see from documentation CfnRestAPi create AWS::ApiGateway::RestApi instead RestApi create a REST API in Amazon API Gateway. They look like similar but I could get the differences(also because the property are similar).
CfnRestApi is a low-level construct with a narrow job: create a CloudFormation
AWS::ApiGateway::RestApiresource using the CloudFormation API. Configuration is manual and you must create related resources yourself.Many, but not all CDK L1
CfnFooconstructs have a higher-level L2Foocounterpart. RestApi is one such Layer 2 construct. It adds abstractions on top ofCfnRestApito make building a working API easier. It creates multiple resources for you under the hood in addition to aAWS::ApiGateway::RestApi(a root API resource, IAM role and potentially many more depending on your configuration).See the docs for a general discussion of the L1, L2 and L3 (= patterns that combine L2 resources) model.