Use DeleteTags with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DeleteTags with a CLI

The following code examples show how to use DeleteTags.

CLI
AWS CLI

To delete a tag from a WorkSpace

The following delete-tags example deletes the specified tag from the specified WorkSpace.

aws workspaces delete-tags \ --resource-id ws-dk1xzr417 \ --tag-keys Department

This command produces no output.

For more information, see Tag WorkSpaces resources in the Amazon WorkSpaces Administration Guide.

  • For API details, see DeleteTags in AWS CLI Command Reference.

PowerShell
Tools for PowerShell V4

Example 1: This sample removes the tag associated with the Workspace

Remove-WKSTag -ResourceId ws-w10b3abcd -TagKey "Type"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-WKSTag (DeleteTags)" on target "ws-w10b3abcd". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • For API details, see DeleteTags in AWS Tools for PowerShell Cmdlet Reference (V4).

Tools for PowerShell V5

Example 1: This sample removes the tag associated with the Workspace

Remove-WKSTag -ResourceId ws-w10b3abcd -TagKey "Type"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-WKSTag (DeleteTags)" on target "ws-w10b3abcd". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • For API details, see DeleteTags in AWS Tools for PowerShell Cmdlet Reference (V5).