Update AWS Lambda API Key Usage Plans with boto3
<p>I have an API Key associated with a particular usage plan. How do I use <code>boto3</code> to update the usage plan to another usage plan?</p>

<p>I've tried the following methods:</p>

<p><a href="http://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.update_usage_plan" rel="nofollow">update_api_key()</a> // add, remove and replace operations do not have usage plan path
<a href="http://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.update_usage_plan" rel="nofollow">update_usage_plan()</a> // add, remove and replace operations do not have usage plan path</p>

<p>I thought about remove the key from the plan then re-adding but there are no usage plan paths.</p>

<p>You are looking for <a href="http://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.create_usage_plan_key" rel="nofollow">create_usage_plan_key</a></p>

<p>i.e.</p>

<pre><code>response = client.create_usage_plan_key(
    usagePlanId='12345',
    keyId='[API_KEY_ID]',
    keyType='API_KEY'
)
</code></pre>

python amazon-web-services aws-api-gateway boto3