cloudposse / terraform-aws-ec2-instance

Terraform module for provisioning a general purpose EC2 host
https://cloudposse.com/accelerate
Apache License 2.0
166 stars 220 forks source link

Tags for EIPs #189

Closed viliampucik closed 6 months ago

viliampucik commented 6 months ago

Describe the Feature

After changing additional_ips_count from 0 to 1, the newly created secondary EIP does not inherit tags from the pre-existing EC2 instance. Can tags be enabled explicitly for EIPs by the module?

Expected Behavior

All EIPs are properly tagged.

Use Case

I've created a new EC2 instance with public EIP using the module. After some time I had to add another public static IP to the EC2, so I've increased additional_ips_count from 0 to 1. The additional EIP was created, but without any tags.

Describe Ideal Solution

All EIPs have tags automatically assigned to them either explicitly by the module or by AWS.

Alternatives Considered

Adding default_tags {} section into AWS provider block adds tags to EIP, but also to other resources. In case of EC2's EBS, it tried to add the same tags each terraform apply, which was inconvenient.

Additional Context

No response

bwmetcalf commented 6 months ago

@viliampucik https://github.com/cloudposse/terraform-aws-ec2-instance/pull/190