我正在尝试在aws apigateway中创建restapi资源。但是在创建时,我遇到了以下异常:
发生错误:ApiGatewayMethodInventoryV1DateVarNotificationsGet-指定了无效的资源标识符(服务:AmazonApiGateway;状态代码:404;错误代码:NotFoundException;请求ID:5d2a3a47-3056-11e9-80c3-77408dcc9a68)。
和下面是我的yml文件。
资源:
rApiGatewayResourceApi: 类型:AWS :: ApiGateway ::资源 特性: ParentId: Fn :: ImportValue:Fn :: Sub'$ {pOwner}-$ {pEnvironment} -rApiGatewayVehiclesRestApiRootResource' PathPart:api RestApiId: Fn :: ImportValue:Fn :: Sub'$ {pOwner}-$ {pEnvironment} -rApiGatewayVehiclesRestApi'
rApiGatewayResourceVersion1: Type: AWS::ApiGateway::Resource Properties: ParentId: Fn::Ref 'rApiGatewayResourceApi' PathPart: v1 RestApiId: Fn::ImportValue: Fn::Sub '${pOwner}-${pEnvironment}-rApiGatewayVehiclesRestApi' rApiGatewayResourceDateVar: Type: AWS::ApiGateway::Resource Properties: ParentId: Fn::Ref rApiGatewayResourceVersion1 PathPart: '{date}' RestApiId: Fn::ImportValue: Fn::Sub '${pOwner}-${pEnvironment}- rApiGatewayVehiclesRestApi'
rApiGatewayVehiclesPublish: 类型:AWS :: ApiGateway ::资源 特性: ParentId:Fn :: Ref'rApiGatewayResourceDateVar' PathPart:发布 RestApiId: Fn :: ImportValue:Fn :: Sub'$ {pOwner}-$ {pEnvironment} -rApiGatewayVehiclesRestApi'
rApiGatewayVehiclesAcknowledgment: Type: AWS::ApiGateway::Resource Properties: ParentId: Fn::Ref 'rApiGatewayResourceDateVar' PathPart: acknowledgement RestApiId: Fn::ImportValue: Fn::Sub '${pOwner}-${pEnvironment}- rApiGatewayVehiclesRestApi' rApiGatewayVehiclesAcknowledgmentResource: Type: AWS::ApiGateway::Method Properties: ResourceId: Fn::Ref 'rApiGatewayVehiclesAcknowledgment' RestApiId: Fn::ImportValue: Fn::Sub '${pOwner}-${pEnvironment}-rApiGatewayVehiclesRestApi' HttpMethod: POST rApiGatewayVehiclesPublishResource: Type: AWS::ApiGateway::Method Properties: ResourceId: Fn::Ref 'rApiGatewayVehiclesPublish' RestApiId: Fn::ImportValue: Fn::Sub '${pOwner}-${pEnvironment}-rApiGatewayVehiclesRestApi' HttpMethod: GET provider: name: aws runtime: nodejs6.10 stage: dev region: ${self:custom.pRegion} memorySize: 1024
超时:30个apiGateway: restApiId: “ Fn :: ImportValue”:$ {self:custom.pOwner}-$ {self:custom.pEnvironment} -rApiGatewayVehiclesRestApi restApiRootResourceId: “ Fn :: ImportValue”:$ {self:custom.pOwner}-$ {self:custom.pEnvironment} -rApiGatewayVehiclesRestApiRootResource restApi资源: 广告资源/ v1 / {date} /通知:Fn :: Ref rApiGatewayVehiclesPublishResource 库存/ v1 / {date} /致谢:Fn :: Ref rApiGatewayVehiclesAcknowledgmentResource
功能:ShiftDigitalService: 名称:$ {self:service} -ShiftDigitalService 描述:处理ShiftDigital请求 处理程序:dist / handler.handleShiftDigital 事件: -http: 路径:api / v1 / {date} / notifications 方法:GET 请求: 参数: 路径: 日期:是 标头: 内容类型:true
AcknowledgmentService: 名称:$ {self:service} -AcknowledgmentService 描述:流程确认请求 处理程序:dist / handler.handleAcknowledgement 事件: -http: 路径:api / v1 / {date} / acknowledgement 方法:POST 请求: 参数: 路径: 日期:是 标头: 内容类型:true