-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat: improve how to use resource_group in modules #76
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 |
---|---|---|
|
@@ -66,3 +66,19 @@ output "secondary_private_ips" { | |
description = "The secondary private IP addresses of the NAT Gateway." | ||
value = aws_nat_gateway.this.secondary_private_ip_addresses | ||
} | ||
|
||
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
+72
to
+83
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 use of
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,3 +120,19 @@ output "propagated_vpn_gateways" { | |
description = "A list of Virtual Private Gateway IDs which propagate routes from." | ||
value = values(aws_vpn_gateway_route_propagation.this)[*].vpn_gateway_id | ||
} | ||
|
||
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
+126
to
+137
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 use of
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,19 @@ output "egress_rules" { | |
} | ||
} | ||
} | ||
|
||
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
+69
to
+80
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 use of
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,3 +293,19 @@ output "sharing" { | |
shares = module.share | ||
} | ||
} | ||
|
||
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
+299
to
+310
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 use of
|
||
} |
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 use of
merge
here makes the code a bit complex to read. You can simplify this by using a ternary operator for the entire value, which is more direct and readable.