aws-sam-cli

How to export PATH to “sam build” command?

ⅰ亾dé卋堺 提交于 2021-01-05 08:51:14
问题 I'm developing AWS Lambda function on PyCharm. When I do "Run" button, Following error message. /usr/local/bin/sam build MyFunction --template /Users/miyashiiii/Works/myapp/myapp/template.yaml --build-dir /Users/miyashiiii/Works/myapp/myapp/.aws-sam/build Building codeuri: myapp/ runtime: python3.7 metadata: {} functions: ['MyFunction'] Build Failed Error: PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations : ['/usr/bin/python'] which

“SSL: CERTIFICATE_VERIFY_FAILED” Error when publish MQTT, AWS IoT

情到浓时终转凉″ 提交于 2020-12-31 05:38:31
问题 I am getting the following error: [ERROR] SSLError: SSL validation failed for https://data.iot.ap-northeast-2.amazonaws.com/topics/app%2Ftest%2Fresponse?qos=1 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124) Traceback (most recent call last): File "/var/task/app.py", line 197, in lambda_handler mqttcli.test('test', '11111', {}, 1, 200) File "/opt/python/lib/python3.8/site-packages/connectors/MQTTClient.py", line 40, in test

How do I specify template parameters when running AWS SAM Local?

♀尐吖头ヾ 提交于 2020-02-21 12:33:20
问题 Using AWS SAM Local I can test my serverless application locally, which is awesome. I can also deploy to AWS, which apparently takes the same flags as aws cloudformation deploy , so I can pass a parameters file with e.g. application secrets (API keys and such). However, I can't find anything in aws local start-api --help or in the docs on Github about how to use a parameter file when testing locally. How do I point to a parameters file to use with my template when running sam local start-api

connect to mongodb in docker from node app in AWS SAM

风流意气都作罢 提交于 2020-02-07 05:31:24
问题 I am getting errors connecting to mongodb running in a docker container from my Nodejs app running in AWS SAM (used to say "in my host"). I run mongodb like: $ docker run --name mongo-myapp --rm -d -p 27018:27017 mongo and I see the results: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ab8248d17d2d mongo "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 0.0.0.0:27018->27017/tcp mongo-myapp ~~I can successfully connect and insert data using clients running on my host like

Setting environmental variables with !Ref in AWS SAM?

落爺英雄遲暮 提交于 2020-02-04 11:00:44
问题 I'm using SAM CLI v0.8.1. I'm trying to set environmental variable MY_TABLE_VAR as name of the table in my resources (MyTableResource). However, while running my app locally, the MY_TABLE_VAR is undefined. Can you tell me what's wrong in my template and how can I set it properly? Following is my SAM template: Globals: Function: Timeout: 30 Runtime: nodejs8.10 Environment: Variables: MY_TABLE_VAR: !Ref MyTableResource Resources: MyTableResource: Type: AWS::Serverless::SimpleTable Properties:

How can I use api gateway stages via cloudformation or sam?

北城以北 提交于 2020-02-03 09:57:28
问题 I am using AWS SAM to deploy my lambda and api gateway. Below is my template yaml file: AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app Sample SAM Template for sam-app # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: Timeout: 3 Resources: HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs

How can I use api gateway stages via cloudformation or sam?

喜夏-厌秋 提交于 2020-02-03 09:56:09
问题 I am using AWS SAM to deploy my lambda and api gateway. Below is my template yaml file: AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app Sample SAM Template for sam-app # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: Timeout: 3 Resources: HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs

How can I use api gateway stages via cloudformation or sam?

蹲街弑〆低调 提交于 2020-02-03 09:56:04
问题 I am using AWS SAM to deploy my lambda and api gateway. Below is my template yaml file: AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app Sample SAM Template for sam-app # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: Timeout: 3 Resources: HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs