Overview
Thefjall secret command manages secrets stored in AWS SSM Parameter Store. Secrets are namespaced by application and optionally by cluster and service for fine-grained access control.
Usage
Subcommands
set
Set a secret value:get
Retrieve a secret value:list / ls
List all secrets in a namespace:delete / rm
Delete a secret:infrastructure.ts ssmSecrets declaration — a declaration pointing at a deleted parameter breaks the next task launch:
export
Export secrets in dotenv format:exec
Execute a command with secrets as environment variables:import
Import secrets from a.env file:
Error: File path is required.
Options
The
-f short flag has different meanings depending on the subcommand: --from-file for set and --force for delete. Use the long form to avoid ambiguity.Namespace Hierarchy
Secrets are organised in a hierarchical namespace:The cluster name
lambda is reserved — it marks Lambda-scoped paths in the
hierarchy. Use --lambda <function> for Lambda secrets; --cluster lambda
is rejected.fjall secrets exec and fjall secrets export: these merge secrets from parent namespaces (app → cluster → service, with more specific values overriding). Deployed workloads do not inherit — an ECS service reads only its exact /<app>/<cluster>/<service>/ path, and a Lambda only /<app>/lambda/<function>/. App-level secrets are never injected into containers.
Applying Changes to Running Services
ECS tasks read secret values when they start — updating a parameter does not change what already-running tasks see.-
Rotated an existing secret? Restart the running services so new tasks pick up the value. After a successful
setorimporton a terminal, the CLI offers this directly (Apply to myapp's running services now? (Y/n)); it is also available standalone:Seefjall rollout— no build, no deploy, and the restart shows which services were running with stale values before you confirm. -
Added a new key? Run a full deploy so the task definition gains the reference (when you pass
--cluster/--service, the CLI adds the declaration to yourinfrastructure.tsautomatically):
Non-Interactive Mode
For CI/CD pipelines, use the--non-interactive flag with all required options:
Secret Naming Rules
Secret names must:- Start with a letter or underscore
- Contain only letters, numbers, underscores, hyphens, or periods
DATABASE_URLAPI_KEY_V2database-urlmy.secret_internal_flag
2FA_CODE(starts with a number)my secret(contains a space)
Security
- Secrets are stored encrypted in AWS SSM Parameter Store (SecureString type)
- Access is controlled via IAM policies
- Secrets are displayed in plain text only when you explicitly request them (
get,export) or inject them into a process environment (exec); they are never written to logs - Use namespace hierarchy for least-privilege access
Examples
Set multiple secrets
Local development with secrets
CI/CD pipeline
Service-specific secrets
Troubleshooting
Permission Denied
ssm:GetParameter permission for the parameter’s ARN.
Secret Not Found
fjall secrets list --app myapp to see available secrets.
Invalid Secret Name
Next Steps
Deploy an application
Deploy your application to AWS with its secrets attached.
Connect an AWS account
Connect the AWS account that stores secrets in SSM Parameter Store.
Configure a deployment user
Grant the IAM permissions needed to read and write secrets.
Secrets Manager resource
Add an AWS Secrets Manager resource to your infrastructure.