Use RemoveTagsFromOnPremisesInstances with an AWS SDK or CLI - AWS SDK Code Examples

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

Use RemoveTagsFromOnPremisesInstances with an AWS SDK or CLI

The following code examples show how to use RemoveTagsFromOnPremisesInstances.

CLI
AWS CLI

To remove tags from one or more on-premises instances

The following remove-tags-from-on-premises-instances example disassociates the specified on-premises tags in AWS CodeDeploy from on-premises instances. It does not deregister the on-premises instances in AWS CodeDeploy, nor uninstall the AWS CodeDeploy Agent from the instance, nor remove the on-premises configuration file from the instances, nor delete the IAM users that are associated with the instances.

aws deploy remove-tags-from-on-premises-instances \ --instance-names AssetTag12010298EX AssetTag23121309EX \ --tags Key=Name,Value=CodeDeployDemo-OnPrem

This command produces no output.

PowerShell
Tools for PowerShell

Example 1: This example deletes the specified tag for the on-premises instance with the specified name. The command will prompt for confirmation before proceeding. Add the -Force parameter to delete the tag without a prompt.

Remove-CDOnPremiseInstanceTag -InstanceName AssetTag12010298EX -Tag @{"Key" = "Name"; "Value" = "CodeDeployDemo-OnPrem"}