Skip to content

fix: Allow instance Name tag to be overwritten#1538

Merged
antonbabenko merged 2 commits into
terraform-aws-modules:masterfrom
aidan-mundy:instance-name-override
Aug 26, 2021
Merged

fix: Allow instance Name tag to be overwritten#1538
antonbabenko merged 2 commits into
terraform-aws-modules:masterfrom
aidan-mundy:instance-name-override

Conversation

@aidan-mundy

Copy link
Copy Markdown
Contributor

PR o'clock

Description

Allow instance Name tag to be overwritten by the user-defined node-group variable additional_tags. Without this PR, it is impossible to define custom names for instances created as part of a managed node group while using a generated launch template. It was possible to affect the name of the instance by setting a different name for the node-group, but there does not appear to be a technical reason for this to be mandated.

Checklist

Allow instance `Name` tag to be overwritten by the user-defined node-group variable `additional_tags`.

@daroga0002 daroga0002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aidan-mundy very smart solution 🥇

@antonbabenko 👍

@antonbabenko

Copy link
Copy Markdown
Member

@bryantbiggs @barryib This is going to be a breaking change and users expect this feature to be in a major release, right?

I will mark it with the breaking change label and maybe group it with some other change.

@barryib What do you normally do with this kind of change?

@daroga0002

Copy link
Copy Markdown
Contributor

Why this will be breaking change?

I dont think it will change anything as node_groups_defaults by default is empty

variable "node_groups_defaults" {
description = "Map of values to be applied to all node groups. See `node_groups` module's documentation for more details"
type = any
default = {}
}

var.tags is also empty:

https://github.com/terraform-aws-modules/terraform-aws-eks/blob/3b1229837ad61d6e3420196fe3870cc406940cc8/variables.tf#L95-L99

In worst case change with will be done is overwrite Name tag which doesnt have a bigger difference from EKS point of view (overwrite only if somoebody specified into node_groups_defaults map Name tag.

To summarise I think this can be safely merged

@antonbabenko

antonbabenko commented Aug 25, 2021

Copy link
Copy Markdown
Member

@daroga0002 I think you are right. This change is definitely a fix rather than a breaking change. Too late for me & too much EKS for today :)

PS: I will merge it tomorrow morning if other guys don't have anything against it.

@antonbabenko antonbabenko merged commit cb0e677 into terraform-aws-modules:master Aug 26, 2021
@goetzc

goetzc commented Sep 9, 2021

Copy link
Copy Markdown

Is this (v17.18.0) only for launch_template? Instances generated by node_groups still have no Name tag.

@daroga0002

Copy link
Copy Markdown
Contributor

this is for node groups which are creating AMI launch template when you have create_launch_template=true

@aidan-mundy

aidan-mundy commented Sep 9, 2021

Copy link
Copy Markdown
Contributor Author

@goetzc As far as I know, an ASG a node group cannot propagate tags to instances without a launch template. Create a launch template and use it for your node group (or use create_launch_template=true) in order to support tags (including the "Name" parameter, which is just a resource tag that is treated specially in the Console UI)

@aidan-mundy aidan-mundy deleted the instance-name-override branch September 9, 2021 16:02
@lisfo4ka

lisfo4ka commented Sep 9, 2021

Copy link
Copy Markdown
Contributor

Folks, it's a nice idea, but what about worker groups? Should we provide the same option to define custom names to instances for worker groups as well?

There is quite a different approach, but it's hardcoded to the exact pattern without the option to redefine.

@aidan-mundy @daroga0002 @antonbabenko

@github-actions

Copy link
Copy Markdown

I'm going to lock this pull request 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 related to this change, 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 12, 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

Successfully merging this pull request may close these issues.

6 participants