CLI Reference - Static Secrets

📘

NOTE

Looking for a specific command? Use the Table of Contents on the right. ===>

Static Secrets

create-secret

Creates new static secrets and configures their values.

Usage
akeyless create-secret --name mySecret1 --value MyPasswordString
Mandatory Parameters

Parameter

Description

--name

Assign a unique name to the secret.

--value

Enter the value of the secret, which is the password string.

Optional Parameters

Parameter

Description

-m, --metadata

This is especially handy when the name of the secret is generic or not specific enough.

-t, --tag

Use tags as an extra tool for organizing and searching secrets. If the tag you want hasn't yet been created, you can add it as part of secret creation. Use commas to create or indicate mutiple tags: -t Tag1 -t Tag2

-k, --key

Choose an Encryption Key to be used to encrypt your secret. Leave the field empty in order to use the default (protectionKey) system key.

--multiline

The provided value is a multiline value (separated by '\n')

update-secret-val

Updates the password for an existing static secret.

Usage
akeyless update-secret-val --name mySecret1 --value "new value"
Mandatory Parameters

Parameter

Description

--name

Enter the name of the existing secret that you want to update.

--value

Enter the new value for the secret, which is the password string.

Optional Parameters

Parameter

Description

-k, --key

Choose an Encryption Key to be used to encrypt your secret. Leave the field empty in order to use the default (protectionKey) system key.

--multiline

The provided value is a multiline value (separated by '\n').

--new-version

Create a new version for the secret when updating additional values

For other data, such as metadata or tags, use update-item as described in Commands for all items and objects.

get-secret-value

Retrieves the value of a given secret.

Usage
akeyless get-secret-value --name mySecret1
Mandatory Parameters

Parameter

Description

--name

Enter the name of the existing secret that you want to update.

Optional Parameters

Parameter

Description

--version

Get the value of a specific version of the secret.

See Updating and versioning static secrets for information about this value.

show-versions

Shows the list of versions for a specified static or dynamic secret.

Usage
akeyless describe-item --name NAME --show-versions

See Commands for all items and objects and also Updating and versioning static secrets for details.

rollback-secret

Replaces the current version with a previously used version of the static secret value.

Usage
akeyless rollback-secret -n /secret1 --old-version 2
Mandatory Parameters

Parameter

Description

--name

Path to secret.

--old-version

Enter the number of the previous version to which you want to roll the secret back. This version must be older than the current version.

delete-item

Deletes any secret, key, certificate or role. See Commands for all items and objects for details.

Usage
akeyless delete-item -n <path/to/item>
Mandatory Parameters

Parameter

Description

-n, --name

Path to the item to be deleted

Optional Parameters

Parameter

Description

--version

The specific version you want to delete - 0=last version, -1=entire item with all versions (default).

--delete-in-days

The number of days to wait before deleting the item (relevant for keys only). By default 7 days.

--delete-immediately

When delete-in-days=-1, must be set, by default set to false.


Did this page help you?