HashiCorp Cloud Platform
hcp vault-secrets secrets create
Command: hcp vault-secrets secrets create
The hcp vault-secrets secrets create
command creates a new static, rotating,
or dynamic secret under a Vault Secrets application. The configuration for
creating your rotating or dynamic secret will be read from the provided HCL
config file. The following fields are required in the config file: [type
integration_name details]. For help populating the details for a dynamic or
rotating secret, please refer to the API reference
documentation.
Usage
$ hcp vault-secrets secrets create NAME [Optional Flags]
Examples
Create a new static secret in the Vault Secrets application on your active profile:
$ hcp vault-secrets secrets create secret_1 --data-file=tmp/secrets1.txt
Create a new secret in a Vault Secrets application by piping the plaintext secret from a command output:
$ echo -n "my super secret" | hcp vault-secrets secrets create secret_2 --data-file=-
Create a new rotating secret on your active profile from a config file:
$ hcp vault-secrets secrets create secret_1 --secret-type=rotating
--data-file=path/to/file/config.hcl
Create a new dynamic secret interactively on your active profile:
$ hcp vault-secrets secrets create secret_1 --secret-type=dynamic
Positional arguments
NAME
- The name of the secret to create.
Flags
--data-file=DATA_FILE_PATH
- File path to read secret data from. Set this to '-' to read the secret data from stdin for a static secret.--secret-type=SECRET_TYPE
- The type of secret to create: static, rotating, or dynamic.
Inherited Flags
--app=NAME
- The name of the Vault Secrets application. If not specified, the value from the active profile will be used.