Getting Apex to play nicely with AWS API Gateway

Whilst learning Apex I found an interesting issue getting the AWS API Gateway integration working.

Following the instructions the order of play is

  1. apex init
  2. apex infra plan
  3. apex infra apply
  4. apex deploy

If you copy the required files from the example  in the following order

  1. apex init
  2. cp /tmp/apex/_example/infrastructure/dev/api-gateway* infrastructure/dev/
  3. apex infra plan

It errors out as follows.

Errors:

* 1 error(s) occurred:

* Required variable not set: apex_function_hello
⨯ Error: exit status 1

Appears the correct order is

  1. apex init
  2. apex infra plan
  3. apex infra apply
  4. apex deploy
  5. cp /tmp/apex/_example/infrastructure/dev/api-gateway* infrastructure/dev/
  6. apex infra plan
  7. apex infra apply

You can then go and check the API works in the AWS Console.

Loading Google+ Comments ...