DeleteServer - OpsWorks

DeleteServer

Deletes the server and the underlying AWS CloudFormation stacks (including the server's EC2 instance). When you run this command, the server state is updated to DELETING. After the server is deleted, it is no longer returned by DescribeServer requests. If the AWS CloudFormation stack cannot be deleted, the server cannot be deleted.

This operation is asynchronous.

An InvalidStateException is thrown when a server deletion is already in progress. A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.

Request Syntax

{ "ServerName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ServerName

The ID of the server to delete.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 40.

Pattern: [a-zA-Z][a-zA-Z0-9\-]*

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidStateException

The resource is in a state that does not allow you to perform a specified action.

Message

Error or informational message that provides more detail if a resource is in a state that is not valid for performing a specified action.

HTTP Status Code: 400

ResourceNotFoundException

The requested resource does not exist, or access was denied.

Message

Error or informational message that can contain more detail about problems locating or accessing a resource.

HTTP Status Code: 400

ValidationException

One or more of the provided request parameters are not valid.

Message

Error or informational message that can contain more detail about a validation failure.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: