Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon API Gateway - Delete API keys

Can you delete your API keys already created via AWS Management Console's Amazon API Gateway page? Perhaps we can only turn on-off 'Enabled' checkbox?

like image 856
Nao Ohta Avatar asked Dec 04 '25 18:12

Nao Ohta


2 Answers

With the official aws python client you can do

aws apigateway delete-api-key --api-key "MyLoOnGGaNDdObScuEddDKeYYy"
like image 56
FUD Avatar answered Dec 06 '25 07:12

FUD


For the time being you have to use the Amazon API Gateway REST API to delete an API key.

Here is a way with Node.js:

  • Install aws4 package

    npm install aws4
    
  • Use the apikey:delete link relation to delete the API key:

    var https = require('https'),           
        aws4  = require('aws4');
    
    https.request(aws4.sign({
      host  : 'apigateway.us-east-1.amazonaws.com',
      method: 'DELETE',
      path  : '/apikeys/<BASE64-API-KEY-VALUE>'
    }, {
      accessKeyId    : '<YOUR-ACCESS-KEY-ID>',
      secretAccessKey: '<YOUR-SECRET-ACCESS-KEY>'
    }), function(res) {
      res.pipe(process.stdout);
    }).end();
    
like image 45
fsenart Avatar answered Dec 06 '25 07:12

fsenart