1
AWSラムダを使用してEC2インスタンスをCloudWatchから指定された間隔でオフにします。私は、Python 2.7ランタイムを使用してAWSラムダコードを記述し、コード入れ:インラインコードとしてAWS Lambda with Python 2.7エラー
import boto3
region = 'xxxxxx'
instances = ['i-xxxxxxxxxx']
def lambda_handler(event, context):
ec2 = boto3.client('ec2', region_name=region)
ec2.stop_instances(InstanceIds=instances)
print 'stopped your instances: ' + str(instances)
を。しかし、私は手動でEC2インスタンスの停止をテストしたい私は、実行ログに次のエラーを取得するラムダ関数トリガー:
{
"errorMessage": "Handler 'handler' missing on module 'index'"
}
を誰も助けいただければ幸いです。