serverless-add-api-key
serverless-add-api-key copied to clipboard
Provide ApiKeyId & UsagePlanId
Hi,
Not really sure if it can be achieved with this plugin, but I'm looking for a way to use existing apiKey
+ usagePlan
using apiKeyId
& usagePlanId
directly instead of name.
The goal would be to reduce required IAM permissions for the deploy user, i.e. being able to restrict permissions to something like:
{
"Effect": "Allow",
"Action": [
"apigateway:DELETE",
"apigateway:PATCH",
"apigateway:POST",
"apigateway:GET"
],
"Resource": [
"arn:aws:apigateway:us-east-1::/usageplans/yyyy",
"arn:aws:apigateway:us-east-1::/usageplans/yyyy/*",
"arn:aws:apigateway:us-east-1::/apikeys/xxxx",
"arn:aws:apigateway:us-east-1::/apikeys/xxxx/*"
]
},
From what I understand in the code, looks like in this scenario we only need associateRestApiWithUsagePlan
function 🤔