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

[AWS] Pass tags to module creating an ASG #290

Closed
hashibot opened this issue Jun 13, 2017 · 5 comments
Closed

[AWS] Pass tags to module creating an ASG #290

hashibot opened this issue Jun 13, 2017 · 5 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

This issue was originally opened by @mcinteer as hashicorp/terraform#9098. It was migrated here as part of the provider split. The original body of the issue is below.


Hi there,

Terraform Version

$ terraform -v
Terraform v0.7.4

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_autoscaling_group

Terraform Configuration Files

This is an ASG defined in a module with some default tags:

resource "aws_autoscaling_group" "asg" {
  name = "${var.env}-${var.cell}-${var.app}"
  launch_configuration = "${aws_launch_configuration.lc.name}"
  .
  .
  .
  tag {
    key = "Name"
    value = "${var.env}-${var.app}"
    propagate_at_launch = true
  }

  tag {
    key = "app"
    value = "${var.env}-${var.app}"
    propagate_at_launch = true
  }
.
.
.

Info

I'd like to be able to pass this module some extra tags to add to the ASG. for example if I have a couple of different stacks using this module and they both require these default tags but then one of them requires some additional tags. Is this available already? I've done a fair amount of googling on this but cannot find anything on it.

It seems that because each tag is added individually rather than a list of tags that I can't add to the list. Is there a workaround for this or can we get it implemented?

Thanks,
Ryan

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@nicgrayson
Copy link

This is covered in the docs here: https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#interpolated-tags

You can pass in a variable that has type list them concat them

@GaalDornick
Copy link

GaalDornick commented Dec 12, 2017

It will be great to be able to initialize the tags from a map. As mentioned in the original issue, the preferred option is to be able to do

`resource "aws_autoscaling_group" "bar" {
...
tags_propagated = {
Name = "my-name"
AnotherTagForInstances = "foo"
}

tags = {
  MyTagForASGNotPropagted = "baz"
}

}`

@radeksimko radeksimko added the service/autoscaling Issues and PRs that pertain to the autoscaling service. label Jan 25, 2018
@eschwartz
Copy link

eschwartz commented Apr 5, 2018

@nicgrayson

You can pass in a variable that has type list them concat them

You can do that. The problem is -- let's say that you have a module that creates an ASG, but also something like a security group, which accepts tags as a map. And you want to be able to define a set of "global tags", that are applied to all resources created by the module. There's no way use the same var.tags input for both the ASG and the security group

@github-actions
Copy link

github-actions bot commented Apr 4, 2020

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Apr 4, 2020
@github-actions github-actions bot closed this as completed May 4, 2020
@ghost
Copy link

ghost commented Jun 4, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

5 participants