From ef2a903102943fdb37391c536f7bc0a289fe237e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20T=C3=B3th?= Date: Tue, 14 Sep 2021 01:25:53 +0200 Subject: [PATCH] AWS Lambda tutorial quick fixes (#390) * Fix image * Image fix and placeholder * Add placeholders * Placeholders --- .../tutorials/aws-lambda/3rd-party-api-ingest.md | 4 ++-- timescaledb/tutorials/aws-lambda/create-data-api.md | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/timescaledb/tutorials/aws-lambda/3rd-party-api-ingest.md b/timescaledb/tutorials/aws-lambda/3rd-party-api-ingest.md index 6ba61cce9c25..cf5c55edd277 100644 --- a/timescaledb/tutorials/aws-lambda/3rd-party-api-ingest.md +++ b/timescaledb/tutorials/aws-lambda/3rd-party-api-ingest.md @@ -168,7 +168,7 @@ To create a Lambda function from your container, you can use the Lambda ```bash aws lambda create-function --region us-east-1 \ --function-name docker_function --package-type Image \ ---code ImageUri= --role arn:aws:iam::818196790983:role/Lambda +--code ImageUri= --role ``` ## Schedule the Lambda function @@ -193,7 +193,7 @@ an EventBridge trigger. This creates a rule using a [`cron` expression][cron-exa [ { "Id": "docker_lambda_trigger", - "Arn": "" + "Arn": "" } ] ``` diff --git a/timescaledb/tutorials/aws-lambda/create-data-api.md b/timescaledb/tutorials/aws-lambda/create-data-api.md index 53a6e65c50d4..b9b3af2ebdb1 100644 --- a/timescaledb/tutorials/aws-lambda/create-data-api.md +++ b/timescaledb/tutorials/aws-lambda/create-data-api.md @@ -43,9 +43,7 @@ workaround to this issue is to download the ``` 1. At the AWS Lambda console, check to see if your `psycopg2` has been uploaded as a Lambda layer: - ```bash ![aws layers](https://assets.timescale.com/docs/images/tutorials/aws-lambda-tutorial/layers.png) - ``` ## Create a function to fetch and return data from the database When the layer is available to your Lambda function, you can create an API to @@ -111,13 +109,11 @@ Lambda using the `create-function` AWS command. ```bash aws lambda create-function --function-name simple_api_function \ --runtime python3.8 --handler function.lambda_handler \ - --role arn:aws:iam::818196790983:role/Lambda --zip-file fileb://function.zip + --role --zip-file fileb://function.zip ``` 1. You can check that the function has been uploaded correctly by using this command in the AWS console: - ```bash ![aws lambda uploaded](https://assets.timescale.com/docs/images/tutorials/aws-lambda-tutorial/lambda_function.png) - ``` 1. If you make changes to your function code, you need to zip the file again and use the `update-function-code` command to upload the changes: ```bash @@ -268,7 +264,7 @@ API gateway. In AWS terms, you are setting up a of `GET /ticker?symbol={symbol}`: ```bash aws apigateway put-method-response --region us-east-1 \ - --rest-api-id --resource-id r9cakv \ + --rest-api-id --resource-id \ --http-method GET --status-code 200 ``` 1. Connect the API Gateway to the Lambda function: @@ -276,7 +272,7 @@ API gateway. In AWS terms, you are setting up a aws apigateway put-integration --region us-east-1 \ --rest-api-id --resource-id \ --http-method GET --type AWS --integration-http-method POST \ - --uri arn:aws:lambda:us-east-1:818196790983:function:simple_timescale/invocations \ + --uri \ --request-templates file://path/to/integration-request-template.json ``` 1. Pass the Lambda function output to the client as a `200 OK` response: