-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
CoveragedocumentationImprovements or additions to documentationImprovements or additions to documentation
Milestone
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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CoveragedocumentationImprovements or additions to documentationImprovements or additions to documentation