Use DeregisterOnPremisesInstance 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 DeregisterOnPremisesInstance with an AWS SDK or CLI

The following code examples show how to use DeregisterOnPremisesInstance.

CLI
AWS CLI

To deregister an on-premises instance

The following deregister-on-premises-instance example deregisters an on-premises instance with AWS CodeDeploy, but it does not delete the IAM user associated with the instance, nor does it disassociate in AWS CodeDeploy the on-premises instance tags from the instance. It also does not uninstall the AWS CodeDeploy Agent from the instance nor remove the on-premises configuration file from the instance.

aws deploy deregister-on-premises-instance --instance-name AssetTag12010298EX

This command produces no output.

PowerShell
Tools for PowerShell

Example 1: This example deregisters the on-premises instance with the specified name.

Unregister-CDOnPremiseInstance -InstanceName AssetTag12010298EX