aws-lambda

How can I change the name of the API stage in a SAM template?

假装没事ソ 提交于 2021-02-07 07:14:15
问题 I'm using SAM to deploy a Lambda function and make it callable over HTTP with via API Gateway using roughly this template snipplet: MyFunction: Type: AWS::Serverless::Function Properties: … Events: MyApi: Type: Api Properties: Path: / Method: any This works, but it creates an API stage called "Prod", which has to be used as a prefix for all URLs. I don't want my URLs to be "https://something/Prod/foo", I want them to be "https://something/v1/foo", i.e. something that I choose. How do I change

How can I change the name of the API stage in a SAM template?

半世苍凉 提交于 2021-02-07 07:11:05
问题 I'm using SAM to deploy a Lambda function and make it callable over HTTP with via API Gateway using roughly this template snipplet: MyFunction: Type: AWS::Serverless::Function Properties: … Events: MyApi: Type: Api Properties: Path: / Method: any This works, but it creates an API stage called "Prod", which has to be used as a prefix for all URLs. I don't want my URLs to be "https://something/Prod/foo", I want them to be "https://something/v1/foo", i.e. something that I choose. How do I change

How can I change the name of the API stage in a SAM template?

放肆的年华 提交于 2021-02-07 07:10:17
问题 I'm using SAM to deploy a Lambda function and make it callable over HTTP with via API Gateway using roughly this template snipplet: MyFunction: Type: AWS::Serverless::Function Properties: … Events: MyApi: Type: Api Properties: Path: / Method: any This works, but it creates an API stage called "Prod", which has to be used as a prefix for all URLs. I don't want my URLs to be "https://something/Prod/foo", I want them to be "https://something/v1/foo", i.e. something that I choose. How do I change

How can I change the name of the API stage in a SAM template?

混江龙づ霸主 提交于 2021-02-07 07:07:36
问题 I'm using SAM to deploy a Lambda function and make it callable over HTTP with via API Gateway using roughly this template snipplet: MyFunction: Type: AWS::Serverless::Function Properties: … Events: MyApi: Type: Api Properties: Path: / Method: any This works, but it creates an API stage called "Prod", which has to be used as a prefix for all URLs. I don't want my URLs to be "https://something/Prod/foo", I want them to be "https://something/v1/foo", i.e. something that I choose. How do I change

How to Query a Array of objects in DynamoDB using FilterExpression in scan operation

爷,独闯天下 提交于 2021-02-07 06:38:12
问题 How to Query array of objects(workingDays) key containing only "Tue" in dynamoDb with Scan Operation,I have queried using filter Expression but i am getting no results. var queryData = { TableName: tableName, FilterExpression: "contains (workingDays, :dayVal)", ExpressionAttributeValues: { ":dayVal": { S:"Tue" } } }; console.log("getParams ==>", queryData) dynamodb.scan(queryData, function (err, details) { if (err) { console.log(err, err.stack); // an error occurred callback(err, null) } else

How to get and use confirmation 'yes' or 'no' for Alexa skill intent response

99封情书 提交于 2021-02-07 06:25:07
问题 I am developing a Alexa skill in which on launch it will ask Do you want to perform something ? Depending upon user's reply 'yes' or 'no' I want to launch another intent. var handlers = { 'LaunchRequest': function () { let prompt = this.t("ASK_FOR_SOMETHING"); let reprompt = this.t("LAUNCH_REPROMPT"); this.response.speak(this.t("WELCOME_MSG") + ' ' + prompt).listen(reprompt); this.emit(':responseReady'); }, "SomethingIntent": function () { //Launch this intent if the user's response is 'yes'

How to get and use confirmation 'yes' or 'no' for Alexa skill intent response

怎甘沉沦 提交于 2021-02-07 06:24:32
问题 I am developing a Alexa skill in which on launch it will ask Do you want to perform something ? Depending upon user's reply 'yes' or 'no' I want to launch another intent. var handlers = { 'LaunchRequest': function () { let prompt = this.t("ASK_FOR_SOMETHING"); let reprompt = this.t("LAUNCH_REPROMPT"); this.response.speak(this.t("WELCOME_MSG") + ' ' + prompt).listen(reprompt); this.emit(':responseReady'); }, "SomethingIntent": function () { //Launch this intent if the user's response is 'yes'

Can I use AWS API Gateway as a reverse proxy for a S3 website?

六眼飞鱼酱① 提交于 2021-02-07 04:23:11
问题 I have a serverless website on AWS S3. But S3 have a limitation that I want to overcome: it don't allow me to have friendly URLs. For example, I would like to replace URL: www.mywebsite.com/user.html?login=daniel With this URL friendly: www.mywebsite.com/user/daniel So, I would like to know if I can use Lambda together with API Gateway to achieve this. My idea is: API Gateway ---> Lambda function ---> fetch S3 resource The API Gateway will get ANY request, and pass information to a Lambda

S3 Hosting + Api Gateway

大憨熊 提交于 2021-02-07 02:38:10
问题 I'm trying to host a static site in S3 with ability to handle some dynamic content using Lambda/Api Gateway. Can't seem to be able to do that. I want URLs to look like this: example.com/index.html example.com/images/* example.com/css/* example.com/api/* -> API Gateway Also, when redirecting I'd like to keep the example.com as a root domain. I tried RoutingRules in S3, but redirects from the client. I need this to be transparent from the user, like proxying requests. 回答1: You can configure

Can't run AWS SAM CLI under Docker

☆樱花仙子☆ 提交于 2021-02-06 13:51:29
问题 I'm trying to create a Docker image for AWS SAM CLI, but invoking any function gives an error: "Unable to import module 'index'". I can run the same test case outside of Docker sucessfully. You can clone the test case here or see the files below. I already tried the following: Setting permissions of files and parent folder to 777 (or 755). Disabling SELinux in the Docker daemon (or enabling it). Running Docker under privileged mode (or not). I get the same error using an old (SAM 0.22) Docker