-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: improve how to use resource_group in modules #65
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,3 +47,19 @@ output "updated_at" { | |
| description = "Date and time in RFC3339 format that the EKS access entry was updated." | ||
| value = aws_eks_access_entry.this.modified_at | ||
| } | ||
|
|
||
| output "resource_group" { | ||
| description = "The resource group created to manage resources in this module." | ||
| value = merge( | ||
| { | ||
| enabled = var.resource_group.enabled && var.module_tags_enabled | ||
| }, | ||
| (var.resource_group.enabled && var.module_tags_enabled | ||
| ? { | ||
| arn = module.resource_group[0].arn | ||
| name = module.resource_group[0].name | ||
| } | ||
| : {} | ||
| ) | ||
| ) | ||
|
Comment on lines
+53
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,3 +70,19 @@ output "updated_at" { | |
| # if !contains(["id", "arn", "cluster_name", "addon_name", "addon_version", "service_account_role_arn", "resolve_conflicts_on_create", "resolve_conflicts_on_update", "created_at", "modified_at", "tags", "tags_all"], k) | ||
| # } | ||
| # } | ||
|
|
||
| output "resource_group" { | ||
| description = "The resource group created to manage resources in this module." | ||
| value = merge( | ||
| { | ||
| enabled = var.resource_group.enabled && var.module_tags_enabled | ||
| }, | ||
| (var.resource_group.enabled && var.module_tags_enabled | ||
| ? { | ||
| arn = module.resource_group[0].arn | ||
| name = module.resource_group[0].name | ||
| } | ||
| : {} | ||
| ) | ||
| ) | ||
|
Comment on lines
+76
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,3 +197,19 @@ output "created_at" { | |
| # if !contains(["arn", "access_config", "certificate_authority", "tags", "tags_all", "created_at", "role_arn", "name", "status", "version", "timeouts", "platform_version", "kubernetes_network_config", "id", "endpoint", "encryption_config", "outpost_config", "identity", "vpc_config", "enabled_cluster_log_types", "cluster_id"], k) | ||
| # } | ||
| # } | ||
|
|
||
| output "resource_group" { | ||
| description = "The resource group created to manage resources in this module." | ||
| value = merge( | ||
| { | ||
| enabled = var.resource_group.enabled && var.module_tags_enabled | ||
| }, | ||
| (var.resource_group.enabled && var.module_tags_enabled | ||
| ? { | ||
| arn = module.resource_group[0].arn | ||
| name = module.resource_group[0].name | ||
| } | ||
| : {} | ||
| ) | ||
| ) | ||
|
Comment on lines
+203
to
+214
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,3 +37,19 @@ output "selectors" { | |
| description = "A list of selectors to match for pods to use this Fargate profile." | ||
| value = aws_eks_fargate_profile.this.selector | ||
| } | ||
|
|
||
| output "resource_group" { | ||
| description = "The resource group created to manage resources in this module." | ||
| value = merge( | ||
| { | ||
| enabled = var.resource_group.enabled && var.module_tags_enabled | ||
| }, | ||
| (var.resource_group.enabled && var.module_tags_enabled | ||
| ? { | ||
| arn = module.resource_group[0].arn | ||
| name = module.resource_group[0].name | ||
| } | ||
| : {} | ||
| ) | ||
| ) | ||
|
Comment on lines
+43
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for the |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for the
resource_groupoutput value is a bit complex and can be simplified for better readability. Using a ternary operator makes the intent clearer and ensures a consistent output structure, witharnandnameattributes being present (asnull) even when the resource group is disabled.