5
b3を使用して、オブジェクトがそのバケット内に作成されるたびにs3バケットがAWSラムダを呼び出すように設定します。ここに私のコードは次のとおりです。boto3を使用してlambdaのs3通知を追加できません
s3 = ..boto3 resource
bucket_notification = s3.BucketNotification(bucket_name)
lambda_arn = .. arn for lambda
response = bucket_notification.put(
NotificationConfiguration={'LambdaFunctionConfigurations': [
{
'LambdaFunctionArn': lambda_arn,
'Events': [
's3:ObjectCreated:*'
],
},
]})
私はエラーを取得する:
botocore.exceptions.ClientError: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations
ありがとう:
権限をすることによって追加されます。これは私に頭痛の多くを救った。また、CloudFormationを使用してラムダ関数をデプロイする場合は、必要な権限をテンプレートから直接追加できます。http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission .html –
+1これです。同じ問題にSQSキューの通知を追加しようとしました。私はSQSの終わりに適切なアクセス許可/ポリシーを追加した後に作業を開始しました。 – 3cheesewheel