Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a different set of tags on the instance spun up by Packer #527

Open
palladiumsai opened this issue Feb 24, 2025 · 0 comments
Open

Comments

@palladiumsai
Copy link

Description

A written overview of the feature.

Currently, the tags defined in run_tags are applied to the instance spun up by Packer. All the tags defined in run_tags are also inherited by the finished AMI. This is not always desirable, since one may want to have different set of tags on the instance for provisioning purposes. Attaching a relevant forum discussion: https://discuss.hashicorp.com/t/tags-and-run-tags/62748.

This feature addition might alleviate the pain caused in issue: #361, where the author of the issue requests for a feature to unset the run_tags on the finished AMI. This will not be a problem if the resulting AMI does not inherit them in the first place.

Potential configuration

I propose we add a new block, say run_instance_tags similar to run_volume_tags which specifies the tags to be applied to the EC2 instance spun up by Packer. This can be a template engine like other tags block.

  • if run_tags and run_instance_tags are defined, only tags in run_instance_tags will be applied to the instance spun up by Packer
  • if run_instance_tags is not defined, then the tags in run_tags will be applied to said EC2 instance.

Alternatively, one might decide to have another block -- say final_ami_tags which determines the set of tags on the final AMI. tags currently does this, but this does not unset the tags set using run_tags

Potential References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant