aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

Add API name to AWS::ApiGateway::RestApi return values #1918

Open asjohnston-asf opened 5 months ago

asjohnston-asf commented 5 months ago

Name of the resource

AWS::ApiGateway::RestApi

Resource name

No response

Description

Please add the API name to the the return values of the AWS::ApiGateway::RestApi resource. Currently, the return values are limited to RestApiId and RootResourceId.

Our specific use case relates to CloudWatch Metrics, where ApiName is a required dimension for REST APIs. For example, we'd like to be able to create a CloudWatch Alarm to monitor for 5xx errors as follows:

AWSTemplateFormatVersion: 2010-09-09

Resources:

  RestApi:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Body:
        openapi: 3.0.3

  Alarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      Namespace: AWS/ApiGateway
      MetricName: 5XXError
      Dimensions:
        - Name: ApiName
          Value: !GetAtt RestApi.Name
      Statistic: Sum
      ComparisonOperator: GreaterThanThreshold
      EvaluationPeriods: 1
      Period: 60
      Threshold: 0

Other Details

No response