untagResource
Removes specific tags from a secret.
This operation is idempotent. If a requested tag is not attached to the secret, no error is returned and the secret metadata is unchanged.
If you use tags as part of your security strategy, then removing a tag can change permissions. If successfully completing this operation would result in you losing your permissions for this secret, then the operation is blocked and returns an Access Denied error.
Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.
**Required permissions: **secretsmanager:UntagResource
. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.
Samples
fun main() {
//sampleStart
// The following example shows how to remove two tags from a secret s metadata. For each, both the tag
// and the associated value are removed. There is no output from this API. To see the result, use the
// DescribeSecret operation.
secretsManagerClient.untagResource {
secretId = "MyTestDatabaseSecret"
tagKeys = listOf<String>(
"FirstTag",
"SecondTag"
)
}
//sampleEnd
}