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

AWS::ApiGateway::Stage - Please correct the documentation as the DeploymentId attribute to mandatory. I.e. ( Required: No ) to (Required: Yes)

Open
#1,960 1 comment 0 reactions 0 assignees View on GitHub
Coverage documentation
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::Stage

### Resource name

_No response_

### Reference Link

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html

### Details

From the documentation, I see only the mandatory attribute is RestApiId (Required: Yes) which is given as required. So while deploying with below template

```
AWSTemplateFormatVersion: 2010-09-09
Parameters:
StageName:
Description: The environment name (e.g., dev, test, prod)
Type: String

Resources:
TestApi:
Type: 'AWS::ApiGateway::RestApi'
Properties:
Description: API used for test endpoint
Name: 'test'
Description: 'test API'
FailOnWarnings: 'true'
EndpointConfiguration:
Types:
- REGIONAL

APIStage:
Type: 'AWS::ApiGateway::Stage'
Properties:
RestApiId: !Ref TestApi
StageName: !Ref StageName
Description: 'API Stage'
```

IT is throwing an error "DeploymentId cannot be empty" . But providing with DeploymentId attribute for AWS::ApiGateway::Stage resource type the stack got deployed with below snippet.

```
AWSTemplateFormatVersion: 2010-09-09
Parameters:
StageName:
Description: The environment name (e.g., dev, test, prod)
Type: String

Resources:
TestApi:
Type: 'AWS::ApiGateway::RestApi'
Properties:
Description: API used for test endpoint
Name: 'test'
Description: 'test API'
FailOnWarnings: 'true'
EndpointConfiguration:
Types:
- REGIONAL

TestResource:
Type: 'AWS::ApiGateway::Resource'
Properties:
RestApiId: !Ref TestApi
ParentId: !GetAtt 'TestApi.RootResourceId'
PathPart: 'customer'


MockMethod:
Type: 'AWS::ApiGateway::Method'
Properties:
RestApiId: !Ref TestApi
ResourceId: !GetAtt
- TestApi
- RootResourceId
HttpMethod: GET
AuthorizationType: NONE
RequestParameters:
method.request.header.myheader: false
Integration:
Type: MOCK
RequestParameters:
integration.request.header.header1: method.request.header.myheader
IntegrationResponses:
- StatusCode: '200'
ResponseParameters:
method.response.header.header1: integration.response.header.header1
method.response.header.header2: "'staticvalue'"
MethodResponses:
- StatusCode: '200'
ResponseParameters:
method.response.header.header1: true
method.response.header.header2: true

Deployment:
DependsOn: MockMethod
Type: 'AWS::ApiGateway::Deployment'
Properties:
RestApiId: !Ref TestApi
Description: My deployment

APIStage:
Type: 'AWS::ApiGateway::Stage'
Properties:
RestApiId: !Ref TestApi
StageName: !Ref StageName
DeploymentId: !Ref Deployment
Description: 'API Stage'
```


Please correct the documentation for AWS::ApiGateway::Stage resource type and change the DeploymentId attribute to mandatory. I.e. ( Required: No ) to (Required: Yes)

Contributor guide

Open the contributing guide

Research direction

Start with the AWS CloudFormation AWS::ApiGateway::Stage reference linked in the issue and compare the DeploymentId requirement with the deployment behavior shown in the templates. Done means the reference accurately marks DeploymentId as required, with the surrounding property details remaining consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.