Skip to content

Commit

Permalink
feat: Simplified outputs (no this_) (terraform-aws-modules#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko authored Apr 8, 2021
1 parent 057fb24 commit eb8051c
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_eventbridge_archive_arns"></a> [eventbridge\_archive\_arns](#output\_eventbridge\_archive\_arns) | The EventBridge Archive Arns created |
| <a name="output_eventbridge_bus_arn"></a> [eventbridge\_bus\_arn](#output\_eventbridge\_bus\_arn) | The EventBridge Bus Arn |
| <a name="output_eventbridge_bus_name"></a> [eventbridge\_bus\_name](#output\_eventbridge\_bus\_name) | The EventBridge Bus Name |
| <a name="output_eventbridge_permission_ids"></a> [eventbridge\_permission\_ids](#output\_eventbridge\_permission\_ids) | The EventBridge Permission Arns created |
| <a name="output_eventbridge_role_arn"></a> [eventbridge\_role\_arn](#output\_eventbridge\_role\_arn) | The ARN of the IAM role created for EventBridge |
| <a name="output_eventbridge_role_name"></a> [eventbridge\_role\_name](#output\_eventbridge\_role\_name) | The name of the IAM role created for EventBridge |
| <a name="output_this_eventbridge_archive_arns"></a> [this\_eventbridge\_archive\_arns](#output\_this\_eventbridge\_archive\_arns) | The EventBridge Archive Arns created |
| <a name="output_this_eventbridge_bus_arn"></a> [this\_eventbridge\_bus\_arn](#output\_this\_eventbridge\_bus\_arn) | The EventBridge Bus Arn |
| <a name="output_this_eventbridge_bus_name"></a> [this\_eventbridge\_bus\_name](#output\_this\_eventbridge\_bus\_name) | The EventBridge Bus Name |
| <a name="output_this_eventbridge_permission_ids"></a> [this\_eventbridge\_permission\_ids](#output\_this\_eventbridge\_permission\_ids) | The EventBridge Permission Arns created |
| <a name="output_this_eventbridge_rule_arns"></a> [this\_eventbridge\_rule\_arns](#output\_this\_eventbridge\_rule\_arns) | The EventBridge Rule ARNs created |
| <a name="output_this_eventbridge_rule_ids"></a> [this\_eventbridge\_rule\_ids](#output\_this\_eventbridge\_rule\_ids) | The EventBridge Rule IDs created |
| <a name="output_eventbridge_rule_arns"></a> [eventbridge\_rule\_arns](#output\_eventbridge\_rule\_arns) | The EventBridge Rule ARNs created |
| <a name="output_eventbridge_rule_ids"></a> [eventbridge\_rule\_ids](#output\_eventbridge\_rule\_ids) | The EventBridge Rule IDs created |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Authors
Expand Down
8 changes: 4 additions & 4 deletions examples/api-gateway-event-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_eventbridge_bus_arn"></a> [eventbridge\_bus\_arn](#output\_eventbridge\_bus\_arn) | The EventBridge Bus Arn |
| <a name="output_eventbridge_bus_name"></a> [eventbridge\_bus\_name](#output\_eventbridge\_bus\_name) | The EventBridge Bus Name |
| <a name="output_eventbridge_role_arn"></a> [eventbridge\_role\_arn](#output\_eventbridge\_role\_arn) | The ARN of the IAM role created for EventBridge |
| <a name="output_eventbridge_role_name"></a> [eventbridge\_role\_name](#output\_eventbridge\_role\_name) | The name of the IAM role created for EventBridge |
| <a name="output_this_eventbridge_bus_arn"></a> [this\_eventbridge\_bus\_arn](#output\_this\_eventbridge\_bus\_arn) | The EventBridge Bus Arn |
| <a name="output_this_eventbridge_bus_name"></a> [this\_eventbridge\_bus\_name](#output\_this\_eventbridge\_bus\_name) | The EventBridge Bus Name |
| <a name="output_this_eventbridge_rule_arns"></a> [this\_eventbridge\_rule\_arns](#output\_this\_eventbridge\_rule\_arns) | The EventBridge Rule ARNs created |
| <a name="output_this_eventbridge_rule_ids"></a> [this\_eventbridge\_rule\_ids](#output\_this\_eventbridge\_rule\_ids) | The EventBridge Rule IDs created |
| <a name="output_eventbridge_rule_arns"></a> [eventbridge\_rule\_arns](#output\_eventbridge\_rule\_arns) | The EventBridge Rule ARNs created |
| <a name="output_eventbridge_rule_ids"></a> [eventbridge\_rule\_ids](#output\_eventbridge\_rule\_ids) | The EventBridge Rule IDs created |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 2 additions & 2 deletions examples/api-gateway-event-source/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module "api_gateway" {
credentials_arn = module.apigateway_put_events_to_eventbridge_role.this_iam_role_arn

request_parameters = jsonencode({
EventBusName = module.eventbridge.this_eventbridge_bus_name,
EventBusName = module.eventbridge.eventbridge_bus_name,
Source = "api.gateway.orders.create",
DetailType = "Order Create",
Detail = "$request.body",
Expand Down Expand Up @@ -114,7 +114,7 @@ data "aws_iam_policy_document" "apigateway_put_events_to_eventbridge_policy" {
statement {
sid = "AllowPutEvents"
actions = ["events:PutEvents"]
resources = [module.eventbridge.this_eventbridge_bus_arn]
resources = [module.eventbridge.eventbridge_bus_arn]
}

depends_on = [module.eventbridge]
Expand Down
16 changes: 8 additions & 8 deletions examples/api-gateway-event-source/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
output "this_eventbridge_bus_name" {
output "eventbridge_bus_name" {
description = "The EventBridge Bus Name"
value = module.eventbridge.this_eventbridge_bus_name
value = module.eventbridge.eventbridge_bus_name
}

output "this_eventbridge_bus_arn" {
output "eventbridge_bus_arn" {
description = "The EventBridge Bus Arn"
value = module.eventbridge.this_eventbridge_bus_arn
value = module.eventbridge.eventbridge_bus_arn
}
output "this_eventbridge_rule_ids" {
output "eventbridge_rule_ids" {
description = "The EventBridge Rule IDs created"
value = module.eventbridge.this_eventbridge_rule_ids
value = module.eventbridge.eventbridge_rule_ids
}

output "this_eventbridge_rule_arns" {
output "eventbridge_rule_arns" {
description = "The EventBridge Rule ARNs created"
value = module.eventbridge.this_eventbridge_rule_arns
value = module.eventbridge.eventbridge_rule_arns
}

output "eventbridge_role_arn" {
Expand Down
6 changes: 3 additions & 3 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
output "eventbridge_bus_arn" {
description = "The EventBridge Bus ARN"
value = module.eventbridge.this_eventbridge_bus_arn
value = module.eventbridge.eventbridge_bus_arn
}

output "eventbridge_rule_ids" {
description = "The EventBridge Rule IDs"
value = module.eventbridge.this_eventbridge_rule_ids
value = module.eventbridge.eventbridge_rule_ids
}

output "eventbridge_rule_arns" {
description = "The EventBridge Rule ARNs"
value = module.eventbridge.this_eventbridge_rule_arns
value = module.eventbridge.eventbridge_rule_arns
}
2 changes: 1 addition & 1 deletion examples/default-bus/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "eventbridge_bus_arn" {
description = "The EventBridge Bus ARN"
value = module.eventbridge.this_eventbridge_bus_arn
value = module.eventbridge.eventbridge_bus_arn
}

4 changes: 2 additions & 2 deletions examples/with-archive/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
output "eventbridge_bus_arn" {
description = "The EventBridge Bus ARN"
value = module.eventbridge.this_eventbridge_bus_arn
value = module.eventbridge.eventbridge_bus_arn
}

output "eventbridge_archive_arns" {
description = "The EventBridge Archive ARNs"
value = module.eventbridge.this_eventbridge_archive_arns
value = module.eventbridge.eventbridge_archive_arns
}

2 changes: 1 addition & 1 deletion examples/with-permissions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ No inputs.
| Name | Description |
|------|-------------|
| <a name="output_eventbridge_bus_arn"></a> [eventbridge\_bus\_arn](#output\_eventbridge\_bus\_arn) | The EventBridge Bus ARN |
| <a name="output_this_eventbridge_permission_ids"></a> [this\_eventbridge\_permission\_ids](#output\_this\_eventbridge\_permission\_ids) | The EventBridge Permissions |
| <a name="output_eventbridge_permission_ids"></a> [eventbridge\_permission\_ids](#output\_eventbridge\_permission\_ids) | The EventBridge Permissions |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6 changes: 3 additions & 3 deletions examples/with-permissions/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
output "eventbridge_bus_arn" {
description = "The EventBridge Bus ARN"
value = module.eventbridge.this_eventbridge_bus_arn
value = module.eventbridge.eventbridge_bus_arn
}

output "this_eventbridge_permission_ids" {
output "eventbridge_permission_ids" {
description = "The EventBridge Permissions"
value = module.eventbridge.this_eventbridge_permission_ids
value = module.eventbridge.eventbridge_permission_ids
}
12 changes: 6 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# EventBridge Bus
output "this_eventbridge_bus_name" {
output "eventbridge_bus_name" {
description = "The EventBridge Bus Name"
value = var.bus_name
}

output "this_eventbridge_bus_arn" {
output "eventbridge_bus_arn" {
description = "The EventBridge Bus Arn"
value = element(concat(aws_cloudwatch_event_bus.this.*.arn, [""]), 0)
}

# EventBridge Archive
output "this_eventbridge_archive_arns" {
output "eventbridge_archive_arns" {
description = "The EventBridge Archive Arns created"
value = { for v in aws_cloudwatch_event_archive.this : v.name => v.arn }
}

# EventBridge Permission
output "this_eventbridge_permission_ids" {
output "eventbridge_permission_ids" {
description = "The EventBridge Permission Arns created"
value = { for k, v in aws_cloudwatch_event_permission.this : k => v.id }
}

# EventBridge Rule
output "this_eventbridge_rule_ids" {
output "eventbridge_rule_ids" {
description = "The EventBridge Rule IDs created"
value = {
for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].id
}
}

output "this_eventbridge_rule_arns" {
output "eventbridge_rule_arns" {
description = "The EventBridge Rule ARNs created"
value = {
for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].arn
Expand Down

0 comments on commit eb8051c

Please sign in to comment.