Akihiro Seki
Akihiro Seki

Reputation: 341

I want to write from AWS API Gateway to RDS directly

I want to post the json data by ajax to AWS API Gateway, and write to RDS directly.

I have to input the mapping template to API Gateway setting. But I can not found the sample for write to RDS. If you know the sample or tutorial, or will not you tell us?

This is the code for write to DynamoDB. I run the same process to RDS.

{ 
    "TableName": "$stageVariables.tablename",
    "Item": {
        "id": {
            "S": "$context.requestId"
            },
        "url": {
            "S": "$input.path('$.url')"
            },
        "event_type": {
            "S": "$input.path('$.event_type')"
            },
        "data": {
            "S": "$input.path('$.data')"
            },
        "created_at": {
            "S": "$input.path('$.event_datetime')"
        }
    }
}

I write that AWS Service is RDS to Integrated Request Setting. But Not in RDS instance name and table name.

Thanks.

Upvotes: 2

Views: 370

Answers (1)

Carlitos12
Carlitos12

Reputation: 61

You can use Lambda in between so that you can make a query or call a procedure directly to RDS.

Upvotes: 1

Related Questions