# AmazonBackupEc2InstanceParameters Object

## Description

Parameters for the Amazon Backup EC2 Instance action.

## Properties

### consistencyMethod

Consistency method to use when creating the EBS snapshots.

Type: `string`

Valid Values:

* `none`
* `stop-instance`
* `vss-with-none-fallback`
* `vss-with-stop-instance-fallback`

Default: `none`

Required: No

### credentialIds

Registered credentials to use with the action. One and only one credential must be specified.

Type: Array of `string`

Required: Yes

### deregisterFromLoadBalancers

Indicates whether to deregister from load balancers when stopping the EC2 instance. Required when `consistencyMethod` is `stop-instance`.

Type: `string`

Valid Values:

* `none`
* `all-load-balancers`

Required: Conditional

### description

Description to assign to the EBS snapshots that are created.

Type: `string`

Required: No

### instanceId

Instance ID of the EC2 instance to backup. Required when `instanceIdentificationMethod` is `by-instance-id`.

Type: `string`

Required: Conditional

### instanceName

Value of the `Name` tag on the EC2 instance to backup. Required when `instanceIdentificationMethod` is `by-instance-name-tag`.

Type: `string`

Required: Conditional

### instanceIdentificationMethod

Method of identifying the EC2 instance.

Type: `string`

Valid Values:

* `by-instance-id`
* `by-instance-name-tag`

Required: Yes

### regionNames

Regions to use with the action. One and only one region must be specified.

Type: Array of `string`

Required: Yes

### snapshotName

Value to assign to the `Name` tag of the EBS snapshots that are created.

Type: `string`

Required: No

### tags

Resource tags to add to the EBS snapshots.

Type: Array of [Tag](https://docs.skeddly.com/data-types/tag-object) object.

Required: No

### targetCredentialId

Credential ID of the AWS credentials to copy the the resulting EBS snapshots. Eg. `cred-12345678`. When setting this field, also set the `targetRegionName` field.

Type: `string`

Required: No

### targetRegionName

Name of a secondary region to copy the resulting EBS snapshots. Must be a valid region. Eg. `us-east-1`

Type: `string`

Required: No

## Sample JSON

```javascript
{
    "credentialIds": [
        "cred-00000001"
    ],
    "regionNames": [
        "us-east-1"
    ],
    "instanceIdentificationMethod": "by-instance-id",
    "instanceId": "i-12345678",

    "consistencyMethod": "stop-instance",
    "deregisterFromLoadBalancers": "none",

    "snapshotName": "$(INSTANCEID)-$(DEVICE)-$(DATE)",
    "description": "Created by Skeddly for $(INSTANCEID) ($(INSTANCENAME))",
    "tags": [
        {
            "key": "skeddly:instance-id",
            "value": "$(INSTANCEID)"
        },
        {
            "key": "skeddly:volume-id",
            "value": "$(VOLUMEID)"
        },
        {
            "key": "skeddly:device",
            "value": "$(DEVICE)"
        }
    ]
}
```
