Robert Phamle
03/30/2024, 7:02 PMMarvin
03/30/2024, 7:02 PMGCPCredentials
block with those credentials, making sure to set overwrite=True
if you want to update the existing credentials block.
Here's an example of creating a GCPCredentials
block:
python
import os
from prefect_gcp import GCPCredentials
my_gcp_creds = GCPCredentials(
service_account_info=os.environ.get("GCP_SERVICE_ACCOUNT_KEY_FILE_CONTENTS"),
)
my_gcp_creds.save(name="my-gcp-creds-block", overwrite=True)
If you want to clear the cache entirely, you may need to delete the credentials block and remove any environment variables or Prefect secrets that may be caching your GCS credentials.
Below are the references to the documentation where these concepts are mentioned:
- Moving Data - Prefect Docs
- Work Pools - Prefect Docs
- Storage Guide - Prefect Docs
Please note that these references don't explicitly mention clearing a credentials cache, but they discuss managing and creating a credentials block, which is typically where credentials are stored and used by Prefect when interacting with GCS. The solution I provided is extrapolated from general practices for managing cloud authentication in code.