2

I have a api gateway set up as follows:

enter image description here

Now I need to update the above set up to to vpc link and the same url so at the end I want to convert it to:

enter image description here

As you see I can do it through console.Can I do the above through cli as well?

I found the following I cannot get a working example.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/update-method.html

https://docs.aws.amazon.com/cli/latest/reference/apigateway/update-rest-api.html

Can anyone help? is it supported at all?

Hamed Minaee
  • 2,480
  • 4
  • 35
  • 63

2 Answers2

1

Its is supported. You are looking for update-integration command https://docs.aws.amazon.com/cli/latest/reference/apigateway/update-integration.html

with connectionType is VPC_LINK

Vishal
  • 635
  • 4
  • 9
  • thanks here is my command : aws apigateway put-integration --rest-api-id 68ez95xgb1 --resource-id u72twj --uri 'awseb-AWSEB-EUBD7GNSIWZS-07xxxx' --http-method GET --type HTTP_PROXY --integration-http-method GET --connection-type VPC_LINK --connection-id xxxx – Hamed Minaee Jul 04 '18 at 01:17
  • when I run it I get Unknown options: --connection-type, --connection-id, gq0oak, VPC_LINK – Hamed Minaee Jul 04 '18 at 01:17
  • can you give an example please? what patch operation should I use? – Hamed Minaee Jul 04 '18 at 01:18
  • put-integration should also work. are you using latest version aws cli ? – Vishal Jul 04 '18 at 01:32
  • Yeah I do. I just tried the update you provided but still the same issue – Hamed Minaee Jul 04 '18 at 01:34
  • Here is my update command: aws apigateway update-integration --rest-api-id 68ez95xgb1 --resource-id u72twj --http-method GET [{"op": "replace","path": "/connectionType","value": "VPC_LINK"}] – Hamed Minaee Jul 04 '18 at 01:35
  • and here is what I got: Unknown options: replace,path:, /connectionType,value:, VPC_LINK}], [{op: – Hamed Minaee Jul 04 '18 at 01:35
  • Still think you are using wrong version of aws cli. You can check it here https://docs.aws.amazon.com/cli/latest/userguide/installing.html – Vishal Jul 06 '18 at 00:44
0

I had the same problem and I managed to solve it by upgrading to the latest aws cli:

pip install awscli --upgrade --user

Afterwards, restart your terminal to make sure you load your latest cli