aws-lambda

How to update a AWS::Lambda::Version always to $LATEST in a CF template

╄→гoц情女王★ 提交于 2020-02-04 06:42:26
问题 I have a Cloudformation template with a Lambda@Edge function. This means I need the lambda function, and a Version (type WS::Lambda::Version). Now, the first time I create the CF template, it works. But when I update the CF template and the Lambda function is updated, the Lambda version does not get updated (kind of makes sense, it did not change!). How can I force the Lambda version to update when the Lambda function updates? 回答1: You can create a script that edits the template before

Question about Lambda execution role when configuring credential rotation for Secret Manager

久未见 提交于 2020-02-04 05:30:05
问题 I created a rotation function manually and linked it to Secret Manager, I've managed to enable the rotation but when I checked the logs in CloudWatch for this rotation lambda, it showing me error: [ERROR] ClientError: An error occurred (AccessDeniedException) when calling the DescribeSecret operation: User: arn:awsxxxxxxx:assumed-role/xxxxx-lambda-exec-role/ MyLambdaName is not authorized to perform: secretsmanager:DescribeSecret on resource: MysecretARN I know something is wrong with my

Is it possible to predict in sagemaker without using s3

北城余情 提交于 2020-02-04 01:41:48
问题 I have a .pkl which I would like to put into production. I would like to do a daily query of my SQL server and do a prediction on about 1000 rows. The documentation implies I have to load the daily data into s3. Is there a way around this? It should be able to fit in memory no problem. The answer to " is there some kind of persistent local storage in aws sagemaker model training? " says that " The notebook instance is coming with a local EBS (5GB) that you can use to copy some data into it

Is it possible for {proxy+} to capture “/” in API Gateway?

孤街浪徒 提交于 2020-02-03 18:59:12
问题 I'm trying to set up a basic reverse-proxy from http://foo.com to http://foo.internal:38121 using API Gateway (so I don't have to get involved w/ deploying NGINX clusters). I cannot just use CloudFront -> http://foo.internal:38121 without API Gateway, since I need to change http://foo.internal:38121 to something else on each deploy... and changing the CloudFront origin would trigger an untenable ~40 minute update. Furthermore, I cannot used fixed ports (so CloudFront w/ fixed origin and a DNS

AWS SAM local and environment parameters

守給你的承諾、 提交于 2020-02-03 10:24:28
问题 I want to get rid off hardcoded passwords in my lambda that is deployed to AWS. I found I shall modify packaged.yaml : Parameters: DATABASE_URI: Description: 'Required. MongoDB connection URL' Type: 'String' Resources: BUDAuthorizeUserHandler: Type: AWS::Serverless::Function Properties: FunctionName: BUDAuthorizeUserHandler Handler: src/handlers/users/authorizeUser.handler Runtime: nodejs10.x Environment: Variables: MONGODB_URI: !Ref DATABASE_URI This is the usage: const MONGODB_URI = process

CDK override bind when using LambdaIntegration

孤人 提交于 2020-02-03 10:21:31
问题 When using LambdaIntegration class the bind function add permission to the lambda automatically: bind(method) { super.bind(method); const principal = new iam.ServicePrincipal('apigateway.amazonaws.com'); const desc = `${method.restApi.node.uniqueId}.${method.httpMethod}.${method.resource.path.replace(/\//g, '.')}`; this.handler.addPermission(`ApiPermission.${desc}`, { principal, scope: method, sourceArn: method.methodArn, }); // add permission to invoke from the console if (this.enableTest) {

How to enable CORS for a local file that references a hosted ASP.NET Web API that is hosted on Amazon AWS

做~自己de王妃 提交于 2020-02-02 14:10:11
问题 So when I open a file that references a hosted ASP.NET Web API 2.0 project, I get the error: Possible cross-origin (CORS) issue? The URL origin (https://secreturl.amazonaws.com) does not match the page (file://). Check the server returns the correct 'Access-Control-Allow-*' headers. I only get answers for enabling cores for an HTTP request pipeline but not for ( file:// ). I open the file from an index.html file, with path file:///C:/Users/PCName/desktop/index.html I assume the CORS have to

How to enable CORS for a local file that references a hosted ASP.NET Web API that is hosted on Amazon AWS

ぃ、小莉子 提交于 2020-02-02 14:09:30
问题 So when I open a file that references a hosted ASP.NET Web API 2.0 project, I get the error: Possible cross-origin (CORS) issue? The URL origin (https://secreturl.amazonaws.com) does not match the page (file://). Check the server returns the correct 'Access-Control-Allow-*' headers. I only get answers for enabling cores for an HTTP request pipeline but not for ( file:// ). I open the file from an index.html file, with path file:///C:/Users/PCName/desktop/index.html I assume the CORS have to

How to enable CORS for a local file that references a hosted ASP.NET Web API that is hosted on Amazon AWS

本小妞迷上赌 提交于 2020-02-02 14:08:46
问题 So when I open a file that references a hosted ASP.NET Web API 2.0 project, I get the error: Possible cross-origin (CORS) issue? The URL origin (https://secreturl.amazonaws.com) does not match the page (file://). Check the server returns the correct 'Access-Control-Allow-*' headers. I only get answers for enabling cores for an HTTP request pipeline but not for ( file:// ). I open the file from an index.html file, with path file:///C:/Users/PCName/desktop/index.html I assume the CORS have to

How do I fail a specific SQS message in a batch from a Lambda?

馋奶兔 提交于 2020-02-02 03:43:38
问题 I have a Lambda with an SQS trigger. When it gets hit, a batch of records from SQS comes in (usually about 10 at a time, I think). If I return a failed status code from the handler, all 10 messages will be retried. If I return a success code, they'll all be removed from the queue. What if 1 out of those 10 messages failed and I want to retry just that one? exports.handler = async (event) => { for(const e of event.Records){ try { let body = JSON.parse(e.body); // do things } catch(e){ // one