hashicorp / hashicorp/packer-plugin-amazon

Syntax/parsing issue when specifying "spot_instance_types" and "enable_unlimited_credits"

Open
#394 2 comments 0 reactions 0 assignees View on GitHub
bug enhancement sync to jira
Dominant language
Go
Stars
91
Forks
141
Avg merge
2d 18h
Merged PRs (30d)
3

Description

#### Overview of the Issue

I am attempting to configure Packer via the AMI/EBS plugin to have a variety of spot instances (T3) with `enable_unlimited_credits` and `spot_pricing` enabled. This does not work as expected, and yields an error message:

```sh
* Error: Instance Type: is not within the supported types for Unlimited credits. Supported instance types are T2, T3, and T4g
```

#### Reproduction Steps

I created a minimal build of Ubuntu 20.04 (x86_64), with the following options:

```hcl
ebs_optimized = true
enable_unlimited_credits = true
spot_price = "auto"
spot_instance_types = [
"t3.medium", "t3.large", "t3.xlarge"
]
```

Early on, during the Packer build operation, it fails with the following (note the double-space after `Error: Instance Type:`; maybe some lookup/indexing function is failing?).

```sh
* Error: Instance Type: is not within the supported types for Unlimited credits. Supported instance types are T2, T3, and T4g
```

If I disable the `enabled_unlimited_credits` feature, then the issue goes away. I'd ideally like to use this feature with a pool of T2 and T3 instance types.

### Plugin and Packer version

```
Installed plugin github.com/hashicorp/amazon v1.2.5 in "/home/ubuntu/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.2.5_x5.0_linux_amd64"
2023/05/31 15:22:36 [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
```

### Simplified Packer Buildfile

Can't provide at the moment, but I could re-create a "hello world" example later this week, if it helps. If I use the above-noted options in the bug report, plus the [boilerplate example](https://developer.hashicorp.com/packer/tutorials/aws-get-started/aws-get-started-build-image) from the docs, I can reproduce the issue.

### Operating system and Environment details

Linux (in AWS); Intel x86_64, Ubuntu 20.04 LTS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.