ancient-wolf-19325
06/27/2024, 8:22 PMSecret class and retrieve them securely within your task:
import flytekit
from flytekit import Secret, task, workflow
SECRET_NAME = "aws_secret_key"
SECRET_GROUP = "aws"
@task(secret_requests=[Secret(group=SECRET_GROUP, key=SECRET_NAME)])
def secret_task() -> str:
secret_val = flytekit.current_context().secrets.get(SECRET_GROUP, SECRET_NAME)
# Use the secret value securely
return secret_val
@workflow
def wf() -> str:
return secret_task()
Would you like more detail on this approach?
Sources:
- Flyte Secrets Documentation
- GitHub Issue on Obfuscating Sensitive Data
- Flytesnacks Example on Using Secrets
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1719519743.309949 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.