Commit f312d055c1838612156bdd127fc05db96c11c16d

Authored by Jan Vonka
1 parent 511187ccbe
Exists in master

Update the README

Showing 1 changed file with 43 additions and 3 deletions   Show diff stats
... ... @@ -9,9 +9,14 @@ https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-
9 9  
10 10 ## Usage
11 11  
12   -Use the following steps to deploy a stack (aws cli should be installed and configured):
  12 +Use the following steps to deploy a stack:
13 13  
14   -build the code using maven
  14 +~~~
  15 +install and configure AWS CLI (note: the DAO tests that run during the build currently assume "eu-west-1" region)
  16 +~~~
  17 +http://docs.aws.amazon.com/cli/latest/userguide/installing.html
  18 +~~~
  19 +build the code using maven - this will also run build tests
15 20 ~~~
16 21 mvn clean install
17 22 ~~~
... ... @@ -23,10 +28,45 @@ package the template and upload the jar to the bucket
23 28 ~~~
24 29 aws cloudformation package --template-file heartbeat-template.yaml --output-template-file heartbeat-template-output.yaml --s3-bucket <bucket-name>
25 30 ~~~
26   -deploy the stack in CF
  31 +deploy the stack using CF cli
27 32 ~~~
28 33 aws cloudformation deploy --stack-name <stack-name> --template heartbeat-template-output.yaml --capabilities CAPABILITY_IAM
29 34 ~~~
  35 +show details of stack after deployment
  36 +~~~
  37 +aws cloudformation describe-stacks --stack-name <stack-name>
  38 +
  39 +Obtain the APIs invoke url (top-level entrypoint):
  40 +
  41 +~~~
  42 +either from the AWS console
  43 +~~~
  44 +http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-call-api.html
  45 +~~~
  46 +or construct yourself (hint: use aws apigateway get-rest-apis to find the restapi_id for given (api/stack) name)
  47 +~~~
  48 +https://{restapi_id}.execute-api.{region}.amazonaws.com/{stage_name}/
  49 +~~~
  50 +
  51 +Send some heartbeat data:
  52 +
  53 +~~~
  54 +use postman or curl. Here's an example with fake data:
  55 +~~~
  56 +curl -X POST https://7a44anmr6e.execute-api.eu-west-1.amazonaws.com/Prod -d '{"repositoryId":" a1d48b32-8309-5c65-acdb-7202c8cd2f9e","feature":"Alfresco Content Services", "payload":{"users":"100","documents":"10000"}, "version":"6.0.0"}'
  57 +~~~
  58 +
  59 +
  60 +Later, you can use the following steps to delete a stack:
  61 +
  62 +~~~
  63 +delete the stack using CF cli
  64 +~~~
  65 +aws cloudformation delete-stack --stack-name <stack-name>
  66 +~~~
  67 +check progress of stack deletion
  68 +~~~
  69 +aws cloudformation describe-stacks --stack-name <stack-name>
30 70  
31 71  
32 72 ## Build plan
... ...