Hello, I am following Using Secrets in a Task <htt...
# ask-the-community
f
Hello, I am following Using Secrets in a Task https://docs.flyte.org/projects/cookbook/en/latest/auto/core/containerization/use_secrets.html And I setup the secrets in K8S, and it works fine to retrieve the secrets.
Copy code
FEATHR_SECRET_GROUP = 'aws'

@task(secret_requests=[Secret(group=FEATHR_SECRET_GROUP, key='s3_access_key'), Secret(group=FEATHR_SECRET_GROUP, key='s3_secret_key')])
def get_feathr_s3_secrets() -> Tuple[str, str]:
    context = current_context()
    s3_access_key = context.secrets.get(FEATHR_SECRET_GROUP, 's3_access_key')
    s3_secret_key = context.secrets.get(FEATHR_SECRET_GROUP, 's3_secret_key')
152 Views