Method: Aws::OpsWorks::Client#delete_instance

Defined in:
lib/aws-sdk-opsworks/client.rb

#delete_instance(params = {}) ⇒ Struct

Deletes a specified instance, which terminates the associated Amazon EC2 instance. You must stop an instance before you can delete it.

For more information, see [Deleting Instances].

**Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see [Managing User Permissions].

[1]: docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html [2]: docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html

Examples:

Request syntax with placeholder values


resp = client.delete_instance({
  instance_id: "String", # required
  delete_elastic_ip: false,
  delete_volumes: false,
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :instance_id (required, String)

    The instance ID.

  • :delete_elastic_ip (Boolean)

    Whether to delete the instance Elastic IP address.

  • :delete_volumes (Boolean)

    Whether to delete the instance’s Amazon EBS volumes.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2196
2197
2198
2199
# File 'lib/aws-sdk-opsworks/client.rb', line 2196

def delete_instance(params = {}, options = {})
  req = build_request(:delete_instance, params)
  req.send_request(options)
end