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 provider v4.0.0 deprecated the use of tags in favor of the tag block in aws_autoscaling_group #1876

Closed
romogo17 opened this issue Feb 14, 2022 · 2 comments

Comments

@romogo17
Copy link

On v4.0.0 of the AWS Provider, tags was deprecated in favor of the tag configuration block in aws_autoscaling_group.

resource/aws_autoscaling_group: The tags argument has been deprecated. All configurations using tags should be updated to use the tag argument instead (hashicorp/terraform-provider-aws#22663)

This makes plans run against this version of the provider show this warning

╷
│ Warning: Argument is deprecated
│ 
│   on .terraform/modules/self-managed-node-group/main.tf line 392, in resource "aws_autoscaling_group" "this":
│  392:   tags = concat(
│  393:     [
│  394:       {
│  395:         key                 = "Name"
│  396:         value               = var.name
│  397:         propagate_at_launch = true
│  398:       },
│  399:       {
│  400:         key                 = "kubernetes.io/cluster/${var.cluster_name}"
│  401:         value               = "owned"
│  402:         propagate_at_launch = true
│  403:       },
│  404:       {
│  405:         key                 = "k8s.io/cluster/${var.cluster_name}"
│  406:         value               = "owned"
│  407:         propagate_at_launch = true
│  408:       },
│  409:     ],
│  410:     var.propagate_tags,
│  411:     [for k, v in var.tags :
│  412:       {
│  413:         key                 = k
│  414:         value               = v
│  415:         propagate_at_launch = true
│  416:       }
│  417:     ]
│  418:   )
│ 
│ Use tag instead
╵

Describe the solution you've considered

Convert this into a dynamic block and bumping the required provider version.

tags = concat(
[
{
key = "Name"
value = var.name
propagate_at_launch = true
},
{
key = "kubernetes.io/cluster/${var.cluster_name}"
value = "owned"
propagate_at_launch = true
},
{
key = "k8s.io/cluster/${var.cluster_name}"
value = "owned"
propagate_at_launch = true
},
],
var.propagate_tags,
[for k, v in var.tags :
{
key = k
value = v
propagate_at_launch = true
}
]
)

@bryantbiggs
Copy link
Member

duplicate #1874

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants