How to link httpApi ApiId from serverless file with CloudFormation template

Hi there,

I am using serverless.yml to create both an API Gateway v2 (HTTP API) and a CloudWatch Dashboard to monitor it.

Unfortunately, CloudWatch Dashboard does not support monitoring an API Gateway v2 by API NAME. The only way to do it is using ApiId. The problem is that sometimes that ID changes. Is there any way I can dynamically retrieve the ID of the HTTP API I am deploying and inject it into the CloudFormation template of the CloudWatch dashboard?

Hopefully my code below makes some sense:

    metrics: true

      Type: AWS::CloudWatch::Dashboard
        DashboardName: MyDashboard
        DashboardBody: '
          "widgets": [
            "type": "metric",
            "properties": {
                "metrics": [
                        "f8d7a6fd8", ============> I want this to be a variable such as ${self:provider.myApiId}
                            "yAxis": "left"
                "view": "bar",
                "stacked": false,
                "region": "us-west-2",
                "period": 300,
                "stat": "Sum",
                "setPeriodToTimeRange": true