Soy particularmente nuevo en Lambda y en AWS en general. Estoy tratando de configurar un servicio API REST simple con Lambda. He usado CloudFormat y CodePipeline para tener una aplicación Express simple. Estoy tratando de averiguar por qué durante la fase de implementación , durante ExecuteChangeSet tengo este error:
Errors found during import: Unable to create resource at path '/stations/{stationId}/allowedUsers': A sibling ({id}) of this resource already has a variable path part -- only one is allowed Unable to create resource at path '/stations/{stationId}/allowedUsers/{userId}': A sibling ({id}) of this resource already has a variable path part -- only one is allowed
Esto es lo que tengo dentro de la plantilla.yml
Events: AllowedUsers: Type: Api Properties: Path: /stations/{stationId}/allowedUsers Method: get AddAllowedUsers: Type: Api Properties: Path: /stations/{stationId}/allowedUsers Method: post DeleteAllowedUsers: Type: Api Properties: Path: /stations/{stationId}/allowedUsers/{userId} Method: delete GetAllowedUser: Type: Api Properties: Path: /stations/{stationId}/allowedUsers/{userId} Method: getBusqué un poco este error pero no estoy seguro de cómo resolverlo.
Para mí, el problema era diferente de lo que se describe en el problema de GitHub que Bryan mencionó.
Estaba usando dos nombres de parámetros diferentes . Terminar la refactorización y usar un solo nombre de identificación solucionó el problema.
Ejemplo:
DeleteAllowedUsers: Type: Api Properties: Path: /stations/{stationId}/allowedUsers/{id} Method: delete GetAllowedUser: Type: Api Properties: Path: /stations/{stationId}/allowedUsers/{userId} Method: get