HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/doc/awscli/examples/secretsmanager/update-secret-version-stage.rst
**To add a staging label attached to a version of a secret**

The following example shows you how to add a staging label to a version of a secret. You can review the results by running the command list-secret-version-ids and viewing the VersionStages response field for the affected version. ::

	aws secretsmanager update-secret-version-stage --secret-id MyTestDatabaseSecret \
	  --version-stage STAGINGLABEL1 \
	  --move-to-version-id EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE

The output shows the following: ::

	{
	  "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
	  "Name": "MyTestDatabaseSecret"
	}

**To delete a staging label attached to a version of a secret**

The following example shows you how to delete a staging label that is attached to a version of a secret. You can review the results by running the command list-secret-version-ids and viewing the VersionStages response field for the affected version. ::

	aws secretsmanager update-secret-version-stage --secret-id MyTestDatabaseSecret \
	  --version-stage STAGINGLABEL1 \
	  --remove-from-version-id EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE

The output shows the following: ::

	{
	  "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
	  "Name": "MyTestDatabaseSecret"
	}
	
**To move a staging label from one version of a secret to another**

The following example shows you how to move a staging label that is attached to one version of a secret to a different version. You can review the results by running the command list-secret-version-ids and viewing the VersionStages response field for the affected version. ::

	aws secretsmanager update-secret-version-stage --secret-id MyTestDatabaseSecret \
	  --version-stage AWSCURRENT \
	  --move-to-version-id EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE \
	  --remove-from-version-id EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE

The output shows the following: ::

	{
	  "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
	  "Name": "MyTestDatabaseSecret"
	}