aws-api-gateway

AWS Api Gateway proxy resource using Cloudformation?

半世苍凉 提交于 2019-12-08 16:37:40
问题 I'm trying to proxy an S3 bucket configured as a website from an API Gateway endpoint. I configured an endpoint successfully using the console, but I am unable to recreate the configuration using Cloudformation. After lots of trial and error and guessing, I've come up with the following CF stack template that gets me pretty close: Resources: Api: Type: 'AWS::ApiGateway::RestApi' Properties: Name: ApiDocs Resource: Type: 'AWS::ApiGateway::Resource' Properties: ParentId: !GetAtt Api

Method PUT is not allowed by Access-Control-Allow-Methods in preflight response, from AWS API Gateway

邮差的信 提交于 2019-12-08 16:27:21
问题 I've got API Gateway setup to point to a lambda function, setup as a aws_proxy . I can GET, POST, DELETE just fine, but I'm trying to add a PUT and I getting Method PUT is not allowed by Access-Control-Allow-Methods in preflight response . XMLHttpRequest cannot load https://api.small.pictures/picture/07e78691-20f9-4a20-8be5-458eaeb73a63. Method PUT is not allowed by Access-Control-Allow-Methods in preflight response. I think I have my CORS setup properly. Here is the swagger user for the

Parse a string of multipart data

徘徊边缘 提交于 2019-12-08 16:17:25
问题 I have a string (base64 decoded here) that looks like this: ----------------------------212550847697339237761929 Content-Disposition: form-data; name="preferred_name"; filename="file1.rtf" Content-Type: application/rtf {\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;;} \margl1440\margr1440\vieww10800\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480

API Gateway - ALB: Hostname/IP doesn't match certificate's altnames

自作多情 提交于 2019-12-08 16:09:48
问题 My setup currently looks like: API Gateway --- ALB --- ECS Cluster --- NodeJS Applications | -- Lambda I also have a custom domain name set on API Gateway (UPDATE: I used the default API gateway link and got the same problem, I don't think this is a custom domain issue) When 1 service in ECS cluster calls another service via API gateway, I get Hostname/IP doesn't match certificate's altnames: "Host: someid.ap-southeast-1.elb.amazonaws.com. is not in the cert's altnames: DNS:*.execute-api.ap

API gateway how to pass AWS IAM authorization from rest client

一曲冷凌霜 提交于 2019-12-08 15:44:59
问题 I am trying to test authenticated API gateway endpoint from rest client. How to I generate/set the "AWS_IAM" authorization headers when making the request ? 回答1: You can use Cognito with a "public" pool id, then attach role to the Cognito pool id, the role being accessing your API GATEWAY AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: 'REGION:YOUR_POOL_ID', }); Use AWS STS to get temporary credentials with limited privileges. After that you can use API Gateway

How to configure backend server to use client side SSL certificates generated by aws gateway api?

≯℡__Kan透↙ 提交于 2019-12-08 14:23:32
I have deployed node js app to ec2 instance of single instance type through elasticbeanstalk. After this I deployed my app through amazon api gateway. My EC2 instance is public. I want to restrict it in such a way that it only accepts request from amazon api gateway. To do this I am following this https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-client-side-ssl-authentication.html I generated a client side certificate through api gateway but I don't know how to use or install this certificate on EC2 instance so that EC2 instance accepts requests only from aws api

AWS API Gateway UnrecognizedClientException with Generated Javascript SDK

一世执手 提交于 2019-12-08 13:31:14
问题 I'm encountering a 403 status code with an UnrecognizedClientException in the x-amzn-errortype header of the response to my API Gateway GET Request using the generated Javascript SDK. The Resource being called utilizes IAM Auth which differentiates the users role based on their user group. Here is my API Client Initialize Function function initializeAPIClient(accessKey, secretKey, sessionToken){ var config = { region : region, accessKey : accessKey, secretKey : secretKey, sessionToken :

Couldn't get the x-amz-tagging value from api gateway to s3

两盒软妹~` 提交于 2019-12-08 11:33:24
问题 I have an aws API Gateway api to upload audio files to s3, sending x-amz-tagging key value pair in header , i get this in Method request headers of api , but the tags are not received at s3? 'x-amz-tagging': 'key1=value1&key2=value2' postman is used to call the api , api call is successfully completed and the file uploaded to s3 but the x-amz-tagging in the method request header is not present in the tags in the s3 回答1: After some research i found a solution, Choose Method Request in your

AWS Api Gateway and Cognito on Android - Error 401

旧巷老猫 提交于 2019-12-08 11:31:49
问题 I'm having problems integrating Cognito with ApiGateway. First I SignIn with Cognito, not problems there, I get all the tokens. Then I have to make a call to API Gateway. I'm using the auto-generated SDK for Android. I'm following the example here: http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk-android.html but I always get the same error. CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider( context, CognitoConstants

Node Middleware Without Express

六眼飞鱼酱① 提交于 2019-12-08 07:57:53
问题 I'm building an AWS Lambda Server to Integrate with API Gateway and I'm unable to expose the server so that I can hook it into Express. I'm wondering if anyone knows a best practice for using middleware without Express. Here is my code. var jobs = require('./jobs'); var http = require('http') const server = http.createServer() server.on('request', (req, res) => { //I want to be able to add a function here that executes all of the middleware that I specify. const { headers, method, url } = req