Pass variables to s3 web app through lambda invoked by API gateway












0















Basically, I have an app that needs to authenticate some Post variables (LTI consumer variables). So my thinking is that I use lambda to authenticate and serve the app in s3 with some variables. e.g. -



LTI Consumer uses POST to invoke -> https://mycoolapp.com -> API Gateway -> Lambda (to authenticate post variables) -> invokes s3 app (on success along with some variables such as userID etc..)



Is this a correct approach, if so how do I set this up?










share|improve this question





























    0















    Basically, I have an app that needs to authenticate some Post variables (LTI consumer variables). So my thinking is that I use lambda to authenticate and serve the app in s3 with some variables. e.g. -



    LTI Consumer uses POST to invoke -> https://mycoolapp.com -> API Gateway -> Lambda (to authenticate post variables) -> invokes s3 app (on success along with some variables such as userID etc..)



    Is this a correct approach, if so how do I set this up?










    share|improve this question



























      0












      0








      0








      Basically, I have an app that needs to authenticate some Post variables (LTI consumer variables). So my thinking is that I use lambda to authenticate and serve the app in s3 with some variables. e.g. -



      LTI Consumer uses POST to invoke -> https://mycoolapp.com -> API Gateway -> Lambda (to authenticate post variables) -> invokes s3 app (on success along with some variables such as userID etc..)



      Is this a correct approach, if so how do I set this up?










      share|improve this question
















      Basically, I have an app that needs to authenticate some Post variables (LTI consumer variables). So my thinking is that I use lambda to authenticate and serve the app in s3 with some variables. e.g. -



      LTI Consumer uses POST to invoke -> https://mycoolapp.com -> API Gateway -> Lambda (to authenticate post variables) -> invokes s3 app (on success along with some variables such as userID etc..)



      Is this a correct approach, if so how do I set this up?







      amazon-web-services amazon-s3 aws-lambda serverless lti






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 28 '18 at 22:27









      John Rotenstein

      68.7k775120




      68.7k775120










      asked Dec 28 '18 at 12:44









      KondaKonda

      3816




      3816
























          1 Answer
          1






          active

          oldest

          votes


















          1














          If I'm not mistaken, your approach certainly feasible, but technically it will not be an S3 web app anymore.



          Amazon S3 have certain feature called static webhost that on enabling it, AWS automatically create a web server serving the files in your s3. If you have static files in them that can be an application (such as html as a web-page) then it is an S3 web app



          With your approach, you are creating an API gateway which integrates with Lambda, then you can do anything on Lambda, including doing authentication, getting the app you store on s3 via s3 api and serve it back to the client. Note that now the one serving the web will be lambda not s3, so technically it's lambda based web server with files stored on S3 :)



          More on Authentication, API gateway have it's own custom authorizer if you want to leverage this for Authentication. With custom authorizer, you can reuse your authorization and authentication logic for other endpoints






          share|improve this answer
























          • True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

            – Konda
            Jan 7 at 5:18











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53958831%2fpass-variables-to-s3-web-app-through-lambda-invoked-by-api-gateway%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          If I'm not mistaken, your approach certainly feasible, but technically it will not be an S3 web app anymore.



          Amazon S3 have certain feature called static webhost that on enabling it, AWS automatically create a web server serving the files in your s3. If you have static files in them that can be an application (such as html as a web-page) then it is an S3 web app



          With your approach, you are creating an API gateway which integrates with Lambda, then you can do anything on Lambda, including doing authentication, getting the app you store on s3 via s3 api and serve it back to the client. Note that now the one serving the web will be lambda not s3, so technically it's lambda based web server with files stored on S3 :)



          More on Authentication, API gateway have it's own custom authorizer if you want to leverage this for Authentication. With custom authorizer, you can reuse your authorization and authentication logic for other endpoints






          share|improve this answer
























          • True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

            – Konda
            Jan 7 at 5:18
















          1














          If I'm not mistaken, your approach certainly feasible, but technically it will not be an S3 web app anymore.



          Amazon S3 have certain feature called static webhost that on enabling it, AWS automatically create a web server serving the files in your s3. If you have static files in them that can be an application (such as html as a web-page) then it is an S3 web app



          With your approach, you are creating an API gateway which integrates with Lambda, then you can do anything on Lambda, including doing authentication, getting the app you store on s3 via s3 api and serve it back to the client. Note that now the one serving the web will be lambda not s3, so technically it's lambda based web server with files stored on S3 :)



          More on Authentication, API gateway have it's own custom authorizer if you want to leverage this for Authentication. With custom authorizer, you can reuse your authorization and authentication logic for other endpoints






          share|improve this answer
























          • True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

            – Konda
            Jan 7 at 5:18














          1












          1








          1







          If I'm not mistaken, your approach certainly feasible, but technically it will not be an S3 web app anymore.



          Amazon S3 have certain feature called static webhost that on enabling it, AWS automatically create a web server serving the files in your s3. If you have static files in them that can be an application (such as html as a web-page) then it is an S3 web app



          With your approach, you are creating an API gateway which integrates with Lambda, then you can do anything on Lambda, including doing authentication, getting the app you store on s3 via s3 api and serve it back to the client. Note that now the one serving the web will be lambda not s3, so technically it's lambda based web server with files stored on S3 :)



          More on Authentication, API gateway have it's own custom authorizer if you want to leverage this for Authentication. With custom authorizer, you can reuse your authorization and authentication logic for other endpoints






          share|improve this answer













          If I'm not mistaken, your approach certainly feasible, but technically it will not be an S3 web app anymore.



          Amazon S3 have certain feature called static webhost that on enabling it, AWS automatically create a web server serving the files in your s3. If you have static files in them that can be an application (such as html as a web-page) then it is an S3 web app



          With your approach, you are creating an API gateway which integrates with Lambda, then you can do anything on Lambda, including doing authentication, getting the app you store on s3 via s3 api and serve it back to the client. Note that now the one serving the web will be lambda not s3, so technically it's lambda based web server with files stored on S3 :)



          More on Authentication, API gateway have it's own custom authorizer if you want to leverage this for Authentication. With custom authorizer, you can reuse your authorization and authentication logic for other endpoints







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 30 '18 at 15:50









          AvermanAverman

          41128




          41128













          • True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

            – Konda
            Jan 7 at 5:18



















          • True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

            – Konda
            Jan 7 at 5:18

















          True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

          – Konda
          Jan 7 at 5:18





          True, but i guess i could just have lambda return a 301 redirect to the s3 url but with a querystring attached for the app to use, and I could pass a JWT token for example rather than the full JSON etc.

          – Konda
          Jan 7 at 5:18


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53958831%2fpass-variables-to-s3-web-app-through-lambda-invoked-by-api-gateway%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas