2

I'm working on a project using Amazon API Gateway and wonder if there's a way through the AWS SDK or over REST to programmatically create API keys for monitoring requests:

AWS API Gateway FAQs

API Key docs

It seems like they want you to use a custom authenticator for security purposes - over depending on an AWS API key. Using an application user for IAM I was thinking my application user would make the actual requests with the AWS IAM key and secret key then add on a user's particular API key for request counts / rate limiting.

Does this approach make sense?

Thanks.

2

2 Answers 2

4

Creating an API key is buried in the AWS SDK for API Gateway

Upon last reading I believe stages are limited to 10,000 API Keys / account so this won't scale at infimum.

create_api_key for API Gateway

Sign up to request clarification or add additional context in comments.

1 Comment

By default, 500 API keys per account/region.
0

AFAIK, you have 2 ways to create AWS Gateway API keys programmatically via:

sample code:

//Create api key
var apiGatewayClient = new AmazonAPIGatewayClient();
await apiGatewayClient.CreateApiKeyAsync(new CreateApiKeyRequest() { Name = apiKey }));

//Add api key to usage plan
var p = new CreateUsagePlanKeyRequest() { UsagePlanId = usagePlanId, KeyId = apiGatewayClient.Id, KeyType = "API_KEY" };
await apiGatewayClient.CreateUsagePlanKeyAsync(p);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.