Comments (7)
Good deal -- glad it worked. I'll update the Gruntfile so the region's there starting out.
from iot-button-ec2-controller.
Sure the region is correct? Can you see the function in the console?
from iot-button-ec2-controller.
Hi :)
Region in index.js matches my arn and I see the function name in the console which matches what I copy into Gruntfile.js. I'm using Oregon, which is us-west-2. I can make in us-east-1 to match your original code to see if that works. Thanks for your help and efforts in making this.
[root@antlet12 iot-button-ec2-controller]# cat index.js
var AWS = require('aws-sdk');
var _ = require('underscore');
var ec2 = new AWS.EC2({ apiVersion: '2016-09-15' });
AWS.config.region = 'us-west-2';
from iot-button-ec2-controller.
Try adding the options: { ... }
section to the lambda_deploy
Gruntfile.
lambda_deploy: {
default: {
arn: 'arn:aws:lambda:us-west-2:570656418299:function:myButtonFunction03',
options: {
region: 'us-west-2'
}
}
},
After a little more digging, it looks like this may be a grunt-aws-lambda issue. If it doesn't work for you by setting the option above, I'll look at re-implementing this with something that works across regions.
from iot-button-ec2-controller.
You're exactly right. Thank you.
Done, without errors.
I see from Tim-B's grunt-aws-lambda that it defaults to us-east-1 if not provided.
options.region
Type: String Default value: us-east-1
Specify the AWS region your functions will be uploaded to. Note that if an ARN is supplied this option is not required.
from iot-button-ec2-controller.
After pressing the button I don't get the IoT Enabled EC2 to start/stop. Where can I see the logs that show the context msg's from index.js? I'm looking in the lambda Cloudwatch log, but not showing up. Do you have a good way to test and troubleshoot? Thanks
from iot-button-ec2-controller.
When I test the lambda function using event.clickType: SINGLE/DOUBLE I get the same result. It's as if it's not able to get the instance ids.
{
"msg": "No instances in a state to be affected by this operation.",
"instanceIds": []
}
START RequestId: 7c733e35-2b2d-11e8-8813-fdb81cdb21c4 Version: $LATEST
2018-03-19T04:25:00.146Z 7c733e35-2b2d-11e8-8813-fdb81cdb21c4 Received event: { 'event.clickType': 'SINGLE' }
END RequestId: 7c733e35-2b2d-11e8-8813-fdb81cdb21c4
REPORT RequestId: 7c733e35-2b2d-11e8-8813-fdb81cdb21c4 Duration: 1058.74 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 38 MB
from iot-button-ec2-controller.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot-button-ec2-controller.