OpsWorks / Client / delete_instance

delete_instance#

OpsWorks.Client.delete_instance(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.delete_instance(
    InstanceId='string',
    DeleteElasticIp=True|False,
    DeleteVolumes=True|False
)
Parameters:
  • InstanceId (string) –

    [REQUIRED]

    The instance ID.

  • DeleteElasticIp (boolean) – Whether to delete the instance Elastic IP address.

  • DeleteVolumes (boolean) – Whether to delete the instance’s Amazon EBS volumes.

Returns:

None

Exceptions

  • OpsWorks.Client.exceptions.ValidationException

  • OpsWorks.Client.exceptions.ResourceNotFoundException