aws-api-gateway

API Gateway HTTP Proxy integration with aws-sam (NOT Lambda Proxy)

拟墨画扇 提交于 2019-12-23 10:47:08
问题 I am trying to use aws-sam to develop / simulate my API Gateway locally. My API gateway makes liberal use of the HTTP proxy integrations. The production Resource looks like this: All of the aws-sam examples which I've found, as well as related documentation and Q&A, use the Lambda integrations / have a hard dependency on a Lambda function being the proxied resource, versus an HTTP Proxy integration. Is there a way to define an HTTP Proxy resource for an aws-sam application? (As opposed to a

AWS API Gateway Custom Authorizer not running

大城市里の小女人 提交于 2019-12-23 10:00:58
问题 I have created a Lambda function which I've configured as the 'custom auth' on the method request of one of my API endpoints. When I use the 'test' function of the AWS API Gateway I don't see any output from my Lambda function in the log output. I have 'deployed' the API. However something is happening because when I hit the api endpoint using the configured custom domain name I get {"message":"Unauthorized"} However if I remove the 'custom auth' from this endpoint and hit the same endpoint,

Destroy resources created via Serverless without destroying Lambda endpoints

匆匆过客 提交于 2019-12-23 09:28:01
问题 I have the following resource defined in my serverless.yml file. Its working great to create the resource for all my different stages of development. resources: Resources: uploadBucket: Type: AWS::S3::Bucket Properties: BucketName: ${self:service}-${self:custom.stage}-uploads visitsTable: Type: AWS::DynamoDB::Table Properties: TableName: ${self:custom.visitsTable} AttributeDefinitions: - AttributeName: userId AttributeType: S - AttributeName: visitId AttributeType: S KeySchema: -

Moving .Net Core Web-API to AWS Web Api Gateway

帅比萌擦擦* 提交于 2019-12-23 05:28:01
问题 I have a Web-API developed with .Net Core.It has few end points ( GET / POST ). The requirement is to move that to AWS API-Gateway. That Web-API is built using layered architecture, it has a business layer that talks to Db layer that got some entity framework repositories ( backend database Postgres). Now i have re-created my solution as a AWS Serverless solution ( using one of the template projects that comes with AWS Toolkit for visual studio). The question is how to make my web api methods

export swagger api definition from api gateway via http request?

此生再无相见时 提交于 2019-12-23 02:51:01
问题 I am trying to export api definition from api gateway using the following http request following the documentation of AWS. Any idea why is it not working? curl -i -X GET -H "Accept: application/json" "https://apigateway.ap-northeast-1.amazonaws.com/restapis/<api-id>/stages/<stage-name>/exports/swagger" Error: HTTP/1.1 403 Forbidden {"message":"Missing Authentication Token"} 回答1: I would recommend that you use the aws cli for exporting swagger instead (http://docs.aws.amazon.com/cli/latest

How to create presigned URL for aws gateway API

非 Y 不嫁゛ 提交于 2019-12-23 01:03:51
问题 I have seen pre-signed URL for S3 object. Is it possible to create pre-signed URL for API gateway. I have gone through documentation. I am using .NET. I would like to know if there is .NET library available to create pre-signed request for gateway API. ISSUE I have GET API something like this https://xxxxxx.execute-api.us-east-1.amazonaws.com/dev/pets?type=dog&page=1 and our client is going to invoke that API once in a while. The legacy tool that they are using only supports GET . So i wanted

AWS Chalice Return an Image File from S3

ε祈祈猫儿з 提交于 2019-12-23 00:51:20
问题 I am using Chalice to build a simple severless application which returns an image file from S3. I am able to return file after it is 64 bit encoded. But I am wondering how I can return the binary file so that user can take it as a file download? My following code is not working. @app.route('/binary_object/{bucket}/{key}', methods=['GET', 'PUT']) def binary_object(bucket, key): request = app.current_request if request.method == 'GET': try: file_path = '/tmp/{}_{}'.format(uuid.uuid4(), key) s3

Client-side SSL not working with AWS API Gateway

浪尽此生 提交于 2019-12-22 17:46:33
问题 I generated a client-side SSL Certificate on API Gateway and added it to my nginx configuration as below: listen *:443; ssl on; server_name api.xxxx.com; ssl_certificate /etc/letsencrypt/live/api.xxxx.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.xxxx.com/privkey.pem; ssl_verify_client on; ssl_client_certificate /etc/nginx/ssl/awsapigateway.crt; location /home/ubuntu/api { # if ($ssl_client_verify != SUCCESS) { return 403; } # proxy_pass http://my.http.public.endpoint.com;

AWS API gateway body mapping template for dynamodb map

霸气de小男生 提交于 2019-12-22 12:40:24
问题 I am trying to figure out how to insert dynamic data into a dynamodb table via an API Gateway in AWS. Currently I have a dynamodb table and an API endpoint setup that accepts a POST like so. POST https://{unique-id}.execute-api.us.east-1.amazonaws.com/notification/events { "reference_number": 99, "purchase_date": "1/1/2017" } I've setup a body mapping template in the API gateway to massage the data into the dynamodb. { "TableName": "Events", "Item": { "reference_number": { "N": "$input.path('

HTTPS Request in Kivy

青春壹個敷衍的年華 提交于 2019-12-22 05:42:13
问题 I've been struggling with HTTPS requests in a Kivy app tied to an API hosted through AWS API Gateway. First, I moved from Python3 to 2 and then from the requests library to kivy's URLRequest. The app works fine on my linux desktop. When I made the API request with the requests library I got an SSL error: SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure I moved to using URLRequest, which seems to be having the same SSL error as requests was. Arguments passed into the URLRequest error