# AmazonCreateAmiImagesParameters Object

## Description

Parameters for the Amazon Create AMI Images action.

## Properties

### credentialIds

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

Type: Array of `string`

Required: Yes

### consistencyMethod

Method used to ensure the AMI image is consistent.

Type: `string`

Valid Values:

* `none`
* `reboot-instance`

Required: Yes

### customImageNameTag

Custom `Name` tag value to apply to the new AMI image. Required when `setImageNameTagMethod` is `custom`.

Type: `string`

Required: Conditional

### customSnapshotNameTag

Custom `Name` tag value to apply to the new EBS snapshots. Required when `setSnapshotNameTagMethod` is `custom`.

Type: `string`

Required: Conditional

### description

Description for the new AMI image.

Type: `string`

Required: No

### imageName

Name for the new AMI image.

Type: `string`

Required: No

### instanceIds

List of EC2 instance IDs that will have AMI images created.

Type: Array of `string`

Required: No

### instanceNameComparison

*Deprecated*

Comparison to use when identifying EC2 instances by `Name` tag. Required when `instanceIdentificationMethod` is `by-instance-name-tag`.

Type: [InstanceNameComparison](https://docs.skeddly.com/data-types/instancenamecomparison-object-1) object.

Required: Conditional

### instanceIdentificationMethod

*Deprecated*

Method of identifying the EC2 instances.

Type: `string`

Valid Values:

* `all-instances`
* `by-instance-id`
* `by-instance-name-tag`
* `by-resource-tag`

Required: Yes

### regionNames

Regions to use with the action. Omit or specify `null` to include "all regions".

Type: Array of `string`

Required: No

### resourceTagComparison

*Deprecated*

Comparison to use when identifying instances by resource tag. Required when `instanceIdentificationMethod` is `by-resource-tag`.

Type: [ResourceTagComparison](https://docs.skeddly.com/data-types/resourcetagcomparison-object-1) object.

Required: Conditional

### resourceTagComparisons

List of resource tag comparisons to use when matching EC2 instances.

Type: List of [ResourceTagComparison](https://docs.skeddly.com/data-types/resourcetagcomparison-object-1) objects.

Required: No

### setImageNameTagMethod

Method to use when setting the `Name` tag of the new AMI image.

Type: `string`

Valid Values:

* `none`
* `same-as-image-name`
* `custom`

Required: No

Default: `none`

### setSnapshotNameTagMethod

Method to use when setting the `Name` tag of the new EBS snapshots.

Type: `string`

Valid Values:

* `none`
* `same-as-image-name`
* `same-as-image-name-tag`
* `custom`

Required: No

Default: `none`

### tags

Resource tags to apply to the new AMI image and EBS snapshots.

Type: Array of [AmiImageTag](https://docs.skeddly.com/data-types/amiimagetag-object) objects

Required: No

### targetCredentialId

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

Type: `string`

Required: No

### targetKmsKeyIdOverride

KMS key to use when copying the AMI images. When setting this field, also set the `targetRegionName` field.

Type: `string`

Required: No

### targetRegionName

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

Type: `string`

Required: No

### volumeChanges

Changes to make to the volumes for the AMI image.

Type: [AmiImageVolumeChanges](https://docs.skeddly.com/data-types/amiimagevolumechanges-object) object

Required: No

## Sample JSON

```javascript
{
    "credentialIds": [
        "cred-00000001"
    ],
    "regionNames": [
        "us-east-1",
        "us-east-2"
    ],
    
    "resourceTagComparisons": [
        {
            "tagName": "create-amis",
            "compareType": "equals",
            "tagValue": "daily-0300"
        }
    ],

    "imageName": "$(INSTANCEID)-$(DATE)",
    "description": "Created from $(INSTANCEID)",
    "consistencyMethod": "reboot-instance",

    "setImageNameTagMethod": "same-as-image-name",
    "setSnapshotNameTagMethod": "same-as-image-name",

    "tags": [
        {
            "key": "skeddly:instance-id",
            "value": "$(INSTANCEID)",
            "addToImage": true,
            "addToSnapshots": true
        },
        {
            "key": "skeddly:source-image-id",
            "value": "$(IMAGEID)",
            "addToImage": true,
            "addToSnapshots": true
        }
    ],

    "targetRegionName": "ca-central-1"
}
```
