* Given a topic name, constructs the full topic identifier for the IoT endpoint. * The topic identifier is used to subscribe to the IoT endpoint and listen for incoming events. * The topic identifier is constructed as "sls/region/serviceName/stageName/functionName". * @param {string} topicN
(topicName)
| 804 | * @returns {string} topicId - The full topic identifier for the IoT endpoint. |
| 805 | */ |
| 806 | getTopicId(topicName) { |
| 807 | const region = this.serverless.getProvider('aws').getRegion() |
| 808 | const stage = this.serverless.getProvider('aws').getStage() |
| 809 | const serviceName = this.serverless.service.getServiceName() |
| 810 | |
| 811 | let topicId = `sls/${region}/${serviceName}/${stage}` |
| 812 | |
| 813 | if (topicName) { |
| 814 | topicId += `/${topicName}` |
| 815 | } |
| 816 | |
| 817 | return topicId |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * Parses the dev mode function identifier into an object containing its constituent components. |
no test coverage detected