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

Fix asg default tags #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .terraform.lock.hcl
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this file from the PR

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions modules/agent-nodepool/versions.tf
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the necessity of this change?

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
terraform {
required_version = ">= 0.13"

required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
7 changes: 7 additions & 0 deletions modules/elb/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
10 changes: 7 additions & 3 deletions modules/nodepool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ resource "aws_launch_template" "this" {
#
# Autoscaling group
#
data "aws_default_tags" "this" {}

resource "aws_autoscaling_group" "this" {
name = "${var.name}-rke2-nodepool"
vpc_zone_identifier = var.subnets
Expand Down Expand Up @@ -99,9 +101,11 @@ resource "aws_autoscaling_group" "this" {
}

dynamic "tag" {
for_each = merge({
"Name" = "${var.name}-rke2-nodepool"
}, var.tags)
for_each = merge(
data.aws_default_tags.this.tags,
{ "Name" = "${var.name}-rke2-nodepool" },
var.tags
)

content {
key = tag.key
Expand Down
7 changes: 7 additions & 0 deletions modules/nodepool/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
9 changes: 9 additions & 0 deletions modules/policies/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 0.13"

required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
6 changes: 6 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
terraform {
required_version = ">= 0.13"

required_providers {
aws = {
source = "hashicorp/aws"
}
}
}