|
3 | 3 | #------------------------------------------------------------------------------ |
4 | 4 | output "scheduled_task_cw_event_role_arn" { |
5 | 5 | description = "The Amazon Resource Name (ARN) specifying the role." |
6 | | - value = aws_iam_role.scheduled_task_cw_event_role.arn |
| 6 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].arn : null |
7 | 7 | } |
8 | 8 |
|
9 | 9 | output "scheduled_task_cw_event_role_create_date" { |
10 | 10 | description = "The creation date of the IAM role." |
11 | | - value = aws_iam_role.scheduled_task_cw_event_role.create_date |
| 11 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].create_date : null |
12 | 12 | } |
13 | 13 |
|
14 | 14 | output "scheduled_task_cw_event_role_description" { |
15 | 15 | description = "The description of the role." |
16 | | - value = aws_iam_role.scheduled_task_cw_event_role.description |
| 16 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].description : null |
17 | 17 | } |
18 | 18 |
|
19 | 19 | output "scheduled_task_cw_event_role_id" { |
20 | 20 | description = "The name of the role." |
21 | | - value = aws_iam_role.scheduled_task_cw_event_role.id |
| 21 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].id : null |
22 | 22 | } |
23 | 23 |
|
24 | 24 | output "scheduled_task_cw_event_role_name" { |
25 | 25 | description = "The name of the role." |
26 | | - value = aws_iam_role.scheduled_task_cw_event_role.name |
| 26 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].name : null |
27 | 27 | } |
28 | 28 |
|
29 | 29 | output "scheduled_task_cw_event_role_unique_id" { |
30 | 30 | description = "The stable and unique string identifying the role." |
31 | | - value = aws_iam_role.scheduled_task_cw_event_role.unique_id |
| 31 | + value = var.event_rule_role_arn == null ? aws_iam_role.scheduled_task_cw_event_role[0].unique_id : null |
32 | 32 | } |
33 | | - |
34 | 33 | output "aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_id" { |
35 | 34 | description = "The role policy ID, in the form of role_name:role_policy_name." |
36 | | - value = aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy.id |
| 35 | + value = var.event_rule_role_arn == null ? aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy[0].id : null |
37 | 36 | } |
38 | 37 |
|
39 | 38 | output "aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_name" { |
40 | 39 | description = "The name of the policy." |
41 | | - value = aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy.name |
| 40 | + value = var.event_rule_role_arn == null ? aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy[0].name : null |
42 | 41 | } |
43 | 42 |
|
44 | 43 | output "aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_policy" { |
45 | 44 | description = "The policy document attached to the role." |
46 | | - value = aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy.policy |
| 45 | + value = var.event_rule_role_arn == null ? aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy[0].policy : null |
47 | 46 | } |
48 | 47 |
|
49 | 48 | output "aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_role" { |
50 | 49 | description = "The name of the role associated with the policy." |
51 | | - value = aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy.role |
| 50 | + value = var.event_rule_role_arn == null ? aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy[0].role : null |
52 | 51 | } |
53 | 52 |
|
54 | 53 | #------------------------------------------------------------------------------ |
|
0 commit comments