You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check if S3 parameter and credentials were set either as a function input or were exported as environment variables.
24
+
"""
25
+
ifbucket_nameisNone:
26
+
bucket_name=os.getenv('BUCKET_NAME')
27
+
ifbucket_nameisNone:
28
+
ifBUCKET_NAMEinglobals():
29
+
bucket_name=BUCKET_NAME
30
+
else:
31
+
raiseValueError("Provide a bucket name for accessing S3 data.\nEither by using an optional argument or exporting an environment variable:\n--s3_bucket_name <bucket_name>\nexport BUCKET_NAME=<bucket_name>")
32
+
33
+
ifservice_endpointisNone:
34
+
service_endpoint=os.getenv('SERVICE_ENDPOINT')
35
+
ifservice_endpointisNone:
36
+
ifSERVICE_ENDPOINTinglobals():
37
+
service_endpoint=SERVICE_ENDPOINT
38
+
else:
39
+
raiseValueError("Provide a service endpoint for accessing S3 data.\nEither by using an optional argument or exporting an environment variable:\n--s3_service_endpoint <endpoint>\nexport SERVICE_ENDPOINT=<endpoint>")
40
+
41
+
ifcredential_fileisNone:
42
+
access_key=os.getenv('AWS_ACCESS_KEY_ID')
43
+
secret_key=os.getenv('AWS_SECRET_ACCESS_KEY')
44
+
45
+
# check for default credentials if no credential_file is provided
raiseValueError(f"Either provide a credential file as an optional argument, have credentials at '{DEFAULT_CREDENTIALS}', or export an access key as an environment variable:\nexport AWS_ACCESS_KEY_ID=<access_key>")
raiseValueError(f"Either provide a credential file as an optional argument, have credentials at '{DEFAULT_CREDENTIALS}', or export a secret access key as an environment variable:\nexport AWS_SECRET_ACCESS_KEY=<secret_key>")
0 commit comments