aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

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

Open
#1,918 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) resource. Currently, the [return values](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#aws-resource-apigateway-restapi-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](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html). For example, we'd like to be able to create a CloudWatch Alarm to monitor for 5xx errors as follows:

```yaml
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_

Contributor guide

Open the contributing guide

Research direction

Start with the AWS::ApiGateway::RestApi return-values documentation and the linked CloudWatch API Gateway metrics and dimensions guidance. Trace how this repository records coverage requests for CloudFormation resources; done means the resource exposes its API name through GetAtt so the CloudWatch Alarm example can use it as the ApiName dimension.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
api, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.