It appears that the plugin does not handle the longer form of the API key definition. Extracting the name from the api key (if it exists) seems to work around the problem.
Here is the diff that solved my problem:
diff --git a/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/apiKeys.js b/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/apiKeys.js
index fe635fd..7f1dbe0 100644
--- a/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/apiKeys.js
+++ b/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/apiKeys.js
@@ -13,6 +13,8 @@ module.exports = {
_.forEach(this.serverless.service.provider.apiKeys, (apiKey, i) => {
const apiKeyNumber = i + 1;
+ apiKey = apiKey.name || apiKey;
+
if (typeof apiKey !== 'string') {
throw new this.serverless.classes.Error('API Keys must be strings');
}
diff --git a/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/usagePlanKeys.js b/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/usagePlanKeys.js
index ff22f2b..a9bbb03 100644
--- a/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/usagePlanKeys.js
+++ b/node_modules/serverless-step-functions/lib/deploy/events/apiGateway/usagePlanKeys.js
@@ -13,6 +13,8 @@ module.exports = {
_.forEach(this.serverless.service.provider.apiKeys, (apiKey, i) => {
const usagePlanKeyNumber = i + 1;
+ apiKey = apiKey.name || apiKey;
+
if (typeof apiKey !== 'string') {
throw new this.serverless.classes.Error('API Keys must be strings');
}
Plugin version: 2.30.0 Serverless versions: 2.0.0 and 2.11.1
When using an api key definition that is not a simple string, deployment fails
serverless.yml
output
It appears that the plugin does not handle the longer form of the API key definition. Extracting the name from the api key (if it exists) seems to work around the problem.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.