Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload object to s3 using aws api gateway service proxy

can any one help i have configured aws api gateway with post method using aws service proxy integration type, then i have configured the resource as s3 and gave bucket details as sub domain in action type i specefied PutObject finally created arn and used that,after all doing this i am able create a random folder in bucket but unable to upload a file which is json type

like image 260
krishna g Avatar asked Dec 08 '22 00:12

krishna g


1 Answers

  1. Created a resource in the following order (root)/s3/{key}
  2. select service proxy
  3. select the desired region
  4. select the desired aws service(s3 in my case)
  5. In subdomain give bucket name
  6. In path override give the parameter as {key}(because to pass the bucketname dynamically)
  7. finally for api gateway service proxy we need to add the arn for detail explanation on creation of arn follow the document http://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-aws-proxy.html
  8. In url path parameters add "key" and mapped from as method.request.path.key
  9. Then deploy
like image 91
krishna g Avatar answered Dec 13 '22 01:12

krishna g