Missing hf-Fehler in AWS Lambda

Meine Entschuldigung für grundlegende Frage. Ich bin völlig neu zu AWS sowie Python. Ich bin versucht zu tun, Beispiel-code im https://boto3.readthedocs.io/en/latest/guide/migrations3.html#accessing-a-bucket aber vor einem Fehler.

import botocore
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('bucketname')
exists = True


try:
    s3.meta.client.head_bucket(Bucket='bucketname')
except botocore.exceptions.ClientError as e:
    # If a client error is thrown, then check that it was a 404 error.
    # If it was a 404 error, then the bucket does not exist.
    error_code = int(e.response['Error']['Code'])
    if error_code == 404:
        exists = False 

Fehler in den logs ist

"errorMessage": "Bearbeiter " lambda_handler' fehlt auf Modul
'lambda_function'"

InformationsquelleAutor chpsam | 2018-01-15
Schreibe einen Kommentar