hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder
https://www.packer.io/docs/builders/amazon
Mozilla Public License 2.0
76 stars 112 forks source link

common: fix subnet_filters when public IP set #370

Closed lbajolet-hashicorp closed 1 year ago

lbajolet-hashicorp commented 1 year ago

In version 1.2.3 of the AWS plugin, we changed the way we set the subnet when the associate_public_ip_address argument is not unset.

This had the side-effect of breaking configuration which specified a subnet_id or a subnet_filter, as it would always default on inferring the most available one from the default (or selected) VPC.

This was a bug, and is fixed with this commit.

Closes #367 Related to #368

lbajolet-hashicorp commented 1 year ago

Right now since we don't have any kind of architecture for unit-testing this step, we won't do it, especially since this broke the plugin for a fair amount of users, so we opted to rely on acceptance testing for this time. We will definitely be revisiting this code and the tests that go with it.

nywilken commented 1 year ago

@JenGoldstrich @lbajolet-hashicorp I opened https://github.com/hashicorp/packer-plugin-amazon/issues/371 to track the unit tests for this code base.