Prashob Nair
11/09/2021, 6:42 PMKevin Kho
Storage(secrets=["AWS_CREDENTIALS"])
. You can find more in the docstring herePrashob Nair
11/09/2021, 7:59 PMbotocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
. Seems like it can't find "AWS_CREDENTIALS"Kevin Kho
Kevin Kho
Unable to locate credentials
Kevin Kho
~./aws
that may be getting pulled?Prashob Nair
11/09/2021, 8:17 PMPrashob Nair
11/09/2021, 8:19 PMKevin Kho
Kevin Kho
Prashob Nair
11/09/2021, 8:26 PMSTORAGE = S3(bucket="bucket-name", secrets=["AWS_CREDENTIALS"])
gives the error botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
Kevin Kho
Kevin Kho
botocore.exceptions.NoCredentialsError: Unable to locate credentials
so your Flow really is pulling something. Is this running on ECS?Prashob Nair
11/09/2021, 8:39 PMPrashob Nair
11/09/2021, 8:49 PMbotocore.exceptions.NoCredentialsError: Unable to locate credentials
Kevin Kho
flow.run()
or a registered run? Could you show me the syntax of your secret?Prashob Nair
11/09/2021, 8:54 PMKevin Kho
Kevin Kho
export PREFECT___CLOUD____USE__LOCAL_SECRETS=False
.Kevin Kho
from prefect import Flow, task
from prefect.tasks.secrets import PrefectSecret
import prefect
@task
def my_task(credentials):
<http://prefect.context.logger.info|prefect.context.logger.info>(credentials)
with Flow("example") as flow:
my_secret = PrefectSecret("AWS_CREDENTIALS")
res = my_task(credentials=my_secret)
flow.run()
Kevin Kho
[2021-11-09 16:06:54-0500] INFO - prefect.my_task | {'ACCESS_KEY': 'AKI......IL4U', 'SECRET_ACCESS_KEY': 'Sz5..........r08'}
Kevin Kho
Kevin Kho
from prefect import Flow, task
from prefect.engine.results import S3Result
from prefect.storage import Local
@task(result=S3Result(bucket="coiled-prefect"), checkpoint=True)
def abc():
return 1
with Flow("s3_test") as flow:
abc()
flow.storage = Local(secrets=["AWS_CREDENTIALS"])
flow.register("bristech")
Prashob Nair
11/09/2021, 9:17 PMValueError: Local Secret "AWS_CREDENTIALS" was not found.
do i check in config.toml ?Kevin Kho
config.toml
also.
[cloud]
use_local_secrets = false
Prashob Nair
11/09/2021, 9:38 PMKevin Kho
Prashob Nair
11/09/2021, 10:00 PMbotocore.exceptions.NoCredentialsError: Unable to locate credentials
any idea why that's happening?
from prefect import Flow, task
from prefect.engine.results import S3Result
from prefect.storage import S3
@task(result=S3Result(bucket="coiled-prefect"), checkpoint=True)
def abc():
return 1
with Flow("s3_test") as flow:
abc()
flow.storage = S3(bucket="coiled-prefect", secrets=["AWS_CREDENTIALS"])
flow.register("bristech")
Kevin Kho
Prashob Nair
11/09/2021, 10:04 PMKevin Kho