Cannot access ApiGatewayRestApi in resources

Also got the HTTP API reference resolved.

resources:
  Resources:
    CloudFrontDistribution:
      Type: AWS::CloudFront::Distribution
      Properties:
        DistributionConfig:
          Origins:
            - Id: ApiGateway
              DomainName:
                Fn::Join:
                  - "."
                  - - Ref: HttpApi
                    - execute-api
                    - Ref: AWS::Region
                    - Ref: AWS::URLSuffix

functions:
  hello:
    handler: handler.hello
    memorySize: 128
    events:
      - httpApi:
          path: /
          method: GET