Michael Delzer Updated by Michael Delzer

Create secret in Environment, Template, or Stack Instance


To create Secret, provide:

  • optionally, entity kind is one of: environment (default), stackTemplate, stackInstance
  • selector is either environment name or id, template name or id, instance full domain name or id
  • secret name
  • secret kind, one of: password, usernamePassword, text, cloudAccount, cloudAccessKeys, privateKey, certificate, sshKey, license, loginToken, gitAccessToken
  • secret plain value, or a number of key:value pairs appropriate for particular secret kind, ie.: password: password usernamePassword: username, password text: text cloudAccount: cloud, roleArn, externalId, duration cloudAccessKeys: accessKey, secretKey privateKey: privateKey certificate: certificate sshKey: sshKey license: licenseKey loginToken, gitAccessToken: loginToken
  • of secret “value” is “-“ then it is read from stdin
hub api secret [entity kind/]<selector> <secret name>[|component] <secret kind> <value | key:value | - ...> [flags]


  -h, --help   help for secret

Options inherited from parent commands

      --all-warnings                   Repeat all warnings before [successful] exit (default true)
--api string Hub API service base URL, HUB_API (default "")
--aws_profile string AWS ~/.aws/credentials profile, AWS_PROFILE (default "agilestacks")
--aws_region string AWS region hint (for S3 state access), AWS_DEFAULT_REGION (default "us-east-2")
--aws_use_iam_role_credentials Try EC2 instance credentials (default true)
--cache string API cache file (default is $HOME/.automation-hub-cache.yaml)
--compressed Write gzip compressed files (default true)
--config string Config file (default is $HOME/.automation-hub.{yaml,json})
-d, --debug Print debug info. Or set HUB_DEBUG=1
--encrypted string Write encrypted files if HUB_CRYPTO_PASSWORD is set. true / false (default "if-password-set")
-f, --force Force operation despite of errors. Or set HUB_FORCE=1
--log-destination string stderr or stdout (default "stderr")
-t, --trace Print detailed trace info. Or set HUB_TRACE=1
-v, --verbose Verbose mode (default true)


Use remote Automation Hub API to access Control Plane, hub_api Click Here

How did we do?