t

    Timo

    1 year ago
    I tried to register a flow to Prefect cloud and store it on S3. AWS_CREDENTIALS is set as secret within Prefect Cloud. If I register the flow i receive the following error:
    botocore.exceptions.NoCredentialsError: Unable to locate credentials
    I register the flow with the following method:
    flow.storage = S3(
        bucket="prefect-flows",
        secrets=["AWS_CREDENTIALS"],
    )
    flow.register(project_name="abc")
    The backend is set to cloud and I logged in successfully (
    prefect auth login ...
    ) How could I use the AWS_CREDENTIALS secret which is set in the cloud?
    CA Lee

    CA Lee

    1 year ago
    Hello @Timo, Prefect cloud secrets are called when the flow is run by your chosen execution environment remotely. For the flow to register successfully, you need to provide creds to botocore locally (see this). There are a couple of ways to do this, but the simplest would be to run
    aws configure
    and enter your access id and key accordingly. Alternatively, you can also create a file called
    ~/.aws/credentials
    , with the following format:
    [default]
    aws_access_key_id = xxx
    aws_secret_access_key = yyy
    Hope the above helps
    t

    Timo

    1 year ago
    Thank you