astroctl organization service-account keys create
Issue an API key to a service account
Synopsis
Issue an API key to a service account.
The secret is printed once, in this command's output, and cannot be retrieved again: store it before you do anything else. The key lasts 24h unless you pass --duration or --permanent.
Terminal
astroctl organization service-account keys create <account> [flags]
Examples
Terminal
# A key valid for 30 days
astroctl org service-account keys create ci --duration 720h
# Capture the secret in a script
astroctl org service-account keys create ci --name github-actions -o json | jq -r .key
Options
Terminal
--duration string How long the key lasts, such as 720h for 30 days (default 24h)
-h, --help help for create
--name string Label for the key
-o, --output string Output format (table|wide|json|yaml) (default "table")
--permanent Issue a key that never expires
SEE ALSO
- astroctl organization service-account keys - Issue, list and revoke a service account's API keys