I am using cloudformation to deploy my code. In my yml file I ahve this DependsOn attribute for which I am trying to add value as "AppApiv1Stage". I have tried multiple things, everytime it gives different errors not sure what I am doing wrong. In the below code snippet first I added it in double quotes like this:"AppApiv1Stage" then it showed error. Again I tried with below code, then it showed me error as "DependsOn must be a string or list of strings"
Parameters:
ApiStageSecondDeploymentName:
Description: API Stage name to use
Type: String
Default: v1
Resources:
AppAPI:
Type: AWS::Serverless::Api
DependsOn: AuthFunction
Properties:
Name: !Sub ${AWS::StackName}
StageName: !Ref ApiStageSecondDeploymentName
Variables:
LocalTLD: local # Deploys a Dev stage to use for tests and development
MethodSettings:
- LoggingLevel: ERROR
MetricsEnabled: True
DataTraceEnabled: True
HttpMethod: '*'
ResourcePath: '/*'
ThrottlingBurstLimit: !Ref ApiBurstLimit
ThrottlingRateLimit: !Ref ApiRateLimit
ApiMapping:
DependsOn: !Sub AppAPI !Ref ${ApiStageSecondDeploymentName}Stage
Type: AWS::ApiGateway::BasePathMapping
Properties:
BasePath: !Ref ApiStageSecondDeploymentName
DomainName:
Fn::ImportValue: !Sub ${CustomDomainStack}-DNSName
RestApiId: !Ref AppAPI
I also tried with Join! but showing error again.