|
1 |
| -locals { |
2 |
| - this_id = compact(coalescelist(aws_instance.this.*.id, [""])) |
3 |
| - this_availability_zone = compact(coalescelist(aws_instance.this.*.availability_zone, [""])) |
4 |
| - this_key_name = compact(coalescelist(aws_instance.this.*.key_name, [""])) |
5 |
| - this_public_dns = compact(coalescelist(aws_instance.this.*.public_dns, [""])) |
6 |
| - this_public_ip = compact(coalescelist(aws_instance.this.*.public_ip, [""])) |
7 |
| - this_primary_network_interface_id = compact(coalescelist(aws_instance.this.*.primary_network_interface_id, [""])) |
8 |
| - this_private_dns = compact(coalescelist(aws_instance.this.*.private_dns, [""])) |
9 |
| - this_private_ip = compact(coalescelist(aws_instance.this.*.private_ip, [""])) |
10 |
| - this_placement_group = compact(coalescelist(aws_instance.this.*.placement_group, [""])) |
11 |
| - this_security_groups = coalescelist(aws_instance.this.*.security_groups, [""]) |
12 |
| - this_vpc_security_group_ids = coalescelist(flatten(aws_instance.this.*.vpc_security_group_ids), [""]) |
13 |
| - this_subnet_id = compact(coalescelist(aws_instance.this.*.subnet_id, [""])) |
14 |
| - this_credit_specification = flatten(aws_instance.this.*.credit_specification) |
15 |
| - this_tags = coalescelist(aws_instance.this.*.tags, [""]) |
16 |
| - this_volume_tags = coalescelist(aws_instance.this.*.volume_tags, [""]) |
17 |
| - this_password_data = coalescelist(aws_instance.this.*.password_data, [""]) |
18 |
| -} |
19 |
| - |
20 | 1 | output "id" {
|
21 | 2 | description = "List of IDs of instances"
|
22 |
| - value = local.this_id |
| 3 | + value = aws_instance.this.*.id |
23 | 4 | }
|
24 | 5 |
|
25 | 6 | output "availability_zone" {
|
26 | 7 | description = "List of availability zones of instances"
|
27 |
| - value = local.this_availability_zone |
| 8 | + value = aws_instance.this.*.availability_zone |
28 | 9 | }
|
29 | 10 |
|
30 | 11 | output "placement_group" {
|
31 | 12 | description = "List of placement groups of instances"
|
32 |
| - value = local.this_placement_group |
| 13 | + value = aws_instance.this.*.placement_group |
33 | 14 | }
|
34 | 15 |
|
35 | 16 | output "key_name" {
|
36 | 17 | description = "List of key names of instances"
|
37 |
| - value = local.this_key_name |
| 18 | + value = aws_instance.this.*.key_name |
38 | 19 | }
|
39 | 20 |
|
40 | 21 | output "public_dns" {
|
41 | 22 | description = "List of public DNS names assigned to the instances. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC"
|
42 |
| - value = local.this_public_dns |
| 23 | + value = aws_instance.this.*.public_dns |
43 | 24 | }
|
44 | 25 |
|
45 | 26 | output "public_ip" {
|
46 | 27 | description = "List of public IP addresses assigned to the instances, if applicable"
|
47 |
| - value = local.this_public_ip |
| 28 | + value = aws_instance.this.*.public_ip |
48 | 29 | }
|
49 | 30 |
|
50 | 31 | output "primary_network_interface_id" {
|
51 | 32 | description = "List of IDs of the primary network interface of instances"
|
52 |
| - value = local.this_primary_network_interface_id |
| 33 | + value = aws_instance.this.*.primary_network_interface_id |
53 | 34 | }
|
54 | 35 |
|
55 | 36 | output "private_dns" {
|
56 | 37 | description = "List of private DNS names assigned to the instances. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC"
|
57 |
| - value = local.this_private_dns |
| 38 | + value = aws_instance.this.*.private_dns |
58 | 39 | }
|
59 | 40 |
|
60 | 41 | output "private_ip" {
|
61 | 42 | description = "List of private IP addresses assigned to the instances"
|
62 |
| - value = local.this_private_ip |
| 43 | + value = aws_instance.this.*.private_ip |
63 | 44 | }
|
64 | 45 |
|
65 | 46 | output "password_data" {
|
66 | 47 | description = "List of Base-64 encoded encrypted password data for the instance"
|
67 |
| - value = local.this_password_data |
| 48 | + value = aws_instance.this.*.password_data |
68 | 49 | }
|
69 | 50 |
|
70 | 51 | output "security_groups" {
|
71 | 52 | description = "List of associated security groups of instances"
|
72 |
| - value = local.this_security_groups |
| 53 | + value = aws_instance.this.*.security_groups |
73 | 54 | }
|
74 | 55 |
|
75 | 56 | output "vpc_security_group_ids" {
|
76 | 57 | description = "List of associated security groups of instances, if running in non-default VPC"
|
77 |
| - value = local.this_vpc_security_group_ids |
| 58 | + value = aws_instance.this.*.vpc_security_group_ids |
78 | 59 | }
|
79 | 60 |
|
80 | 61 | output "subnet_id" {
|
81 | 62 | description = "List of IDs of VPC subnets of instances"
|
82 |
| - value = local.this_subnet_id |
| 63 | + value = aws_instance.this.*.subnet_id |
83 | 64 | }
|
84 | 65 |
|
85 | 66 | output "credit_specification" {
|
86 | 67 | description = "List of credit specification of instances"
|
87 |
| - value = local.this_credit_specification |
| 68 | + value = aws_instance.this.*.credit_specification |
88 | 69 | }
|
89 | 70 |
|
90 | 71 | output "tags" {
|
91 | 72 | description = "List of tags of instances"
|
92 |
| - value = local.this_tags |
| 73 | + value = aws_instance.this.*.tags |
93 | 74 | }
|
94 | 75 |
|
95 | 76 | output "volume_tags" {
|
96 | 77 | description = "List of tags of volumes of instances"
|
97 |
| - value = local.this_volume_tags |
| 78 | + value = aws_instance.this.*.volume_tags |
98 | 79 | }
|
0 commit comments