| Server IP : 167.99.254.82 / Your IP : 216.73.216.188 Web Server : Apache System : Linux host.techisquad.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : pawluxera ( 1011) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/awscli/examples/secretsmanager/ |
Upload File : |
**Example 1: To add a tag to a secret**
The following example shows how to attach a tag with shorthand syntax. ::
aws secretsmanager tag-resource \
--secret-id MyTestSecret \
--tags Key=FirstTag,Value=FirstValue
This command produces no output.
For more information, see `Tag your secrets <https://docs.aws.amazon.com/secretsmanager/latest/userguide/managing-secrets_tagging.html>`__ in the *Secrets Manager User Guide*.
**Example 2: To add multiple tags to a secret**
The following ``tag-resource`` example attaches two key-value tags to a secret. ::
aws secretsmanager tag-resource \
--secret-id MyTestSecret \
--tags '[{"Key": "FirstTag", "Value": "FirstValue"}, {"Key": "SecondTag", "Value": "SecondValue"}]'
This command produces no output.
For more information, see `Tag secrets <https://docs.aws.amazon.com/secretsmanager/latest/userguide/managing-secrets_tagging.html>`__ in the *Secrets Manager User Guide*.