Pass variables to s3 web app through lambda invoked by API gateway
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
add a comment |
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
add a comment |
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
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
amazon-web-services amazon-s3 aws-lambda serverless lti
edited Dec 28 '18 at 22:27
John Rotenstein
68.7k775120
68.7k775120
asked Dec 28 '18 at 12:44
KondaKonda
3816
3816
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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