-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
boolean to make run_tags the same as tags #8695
Comments
Hello @nitrocode, thanks for opening. We recently merged #8588 that allows to use variables in HCL2. I would like to talk about the feasibility of this in Packer HCL2 and how I think it should/will proably work ( we are not quite there yet ): 1/ I think we should add the possibility to define the source "amazon-ebs" "example-source" {
tag {
key = "Name"
value = "example-asg-name"
propagate_at_launch = false
}
//... I think this would solve one issue here. 2/ from there we will need to introduce the dynamic block from Terraform locals {
standard_tags = {
Component = "user-service"
Environment = "production"
}
}
source "amazon-ebs" "example-source" {
// same as before
dynamic "tag" {
for_each = local.standard_tags
content {
key = tag.key
value = tag.value
propagate_at_launch = true
}
} |
Here are the places where that could be handy: Builders:https://github.com/hashicorp/packer/blob/ecaec1ac584895dd8588ba3ffa4e74afad2be20b/builder/alicloud/ecs/image_config.go#L194packer/builder/amazon/common/ami_config.go Line 107 in d084cd1
packer/builder/amazon/common/run_config.go Line 200 in 6655f93
packer/builder/amazon/common/run_config.go Line 284 in 6655f93
packer/builder/cloudstack/config.go Line 164 in 0785c2f
packer/builder/docker/config.go Line 80 in 0785c2f
packer/builder/googlecompute/config.go Line 83 in 0785c2f
packer/builder/googlecompute/config.go Line 83 in 0785c2f
packer/builder/googlecompute/config.go Line 94 in 0785c2f
packer/builder/googlecompute/config.go Line 96 in 0785c2f
packer/builder/hcloud/config.go Line 38 in 0785c2f
packer/builder/hyperone/config.go Line 65 in 0785c2f
packer/builder/hyperone/config.go Line 74 in 0785c2f
Line 38 in 0785c2f
Line 41 in 0785c2f
packer/builder/openstack/image_config.go Line 18 in 6305c55
packer/builder/openstack/run_config.go Line 140 in 5da5b00
packer/builder/openstack/run_config.go Line 192 in 5da5b00
packer/builder/oracle/oci/config.go Line 68 in 0785c2f
packer/builder/osc/common/omi_config.go Line 20 in 793b3f1
packer/builder/triton/source_machine_config.go Lines 54 to 57 in 078ba7c
packer/builder/vmware/common/vmx_config.go Lines 13 to 17 in 4399684
packer/builder/yandex/config.go Line 60 in 0785c2f
packer/builder/yandex/config.go Line 76 in 0785c2f
packer/builder/yandex/config.go Lines 82 to 84 in 0785c2f
There are also post-processors where that could be used. Note that this wouldn't necessarily be a breaking change as a new |
Hey there, yesterday I opened #8720 that adds support for dynamic blocks. Up next we will need to add that new tag specific type. |
This issue has been automatically migrated to hashicorp/packer-plugin-amazon#10 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-amazon#10. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.
Feature Description
I'd like to make
run_tags
the same astags
using a boolean like"tags_same" = true,
or similar which can make all tagging the same as what is defined intags
.Use Case(s)
Tired of adding new tags to one but not the other. I'd like to keep things DRY as much as possible.
The text was updated successfully, but these errors were encountered: