Skip to content

Commit e345486

Browse files
MDBoxantonbabenko
authored andcommitted
Update outputs to remove unneeded function wrappers (#135)
1 parent d09fcfd commit e345486

File tree

2 files changed

+18
-37
lines changed

2 files changed

+18
-37
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.16.0
3+
rev: v1.21.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs
77
- repo: git://github.com/pre-commit/pre-commit-hooks
8-
rev: v2.2.3
8+
rev: v2.4.0
99
hooks:
1010
- id: check-merge-conflict

outputs.tf

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,79 @@
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-
201
output "id" {
212
description = "List of IDs of instances"
22-
value = local.this_id
3+
value = aws_instance.this.*.id
234
}
245

256
output "availability_zone" {
267
description = "List of availability zones of instances"
27-
value = local.this_availability_zone
8+
value = aws_instance.this.*.availability_zone
289
}
2910

3011
output "placement_group" {
3112
description = "List of placement groups of instances"
32-
value = local.this_placement_group
13+
value = aws_instance.this.*.placement_group
3314
}
3415

3516
output "key_name" {
3617
description = "List of key names of instances"
37-
value = local.this_key_name
18+
value = aws_instance.this.*.key_name
3819
}
3920

4021
output "public_dns" {
4122
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
4324
}
4425

4526
output "public_ip" {
4627
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
4829
}
4930

5031
output "primary_network_interface_id" {
5132
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
5334
}
5435

5536
output "private_dns" {
5637
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
5839
}
5940

6041
output "private_ip" {
6142
description = "List of private IP addresses assigned to the instances"
62-
value = local.this_private_ip
43+
value = aws_instance.this.*.private_ip
6344
}
6445

6546
output "password_data" {
6647
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
6849
}
6950

7051
output "security_groups" {
7152
description = "List of associated security groups of instances"
72-
value = local.this_security_groups
53+
value = aws_instance.this.*.security_groups
7354
}
7455

7556
output "vpc_security_group_ids" {
7657
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
7859
}
7960

8061
output "subnet_id" {
8162
description = "List of IDs of VPC subnets of instances"
82-
value = local.this_subnet_id
63+
value = aws_instance.this.*.subnet_id
8364
}
8465

8566
output "credit_specification" {
8667
description = "List of credit specification of instances"
87-
value = local.this_credit_specification
68+
value = aws_instance.this.*.credit_specification
8869
}
8970

9071
output "tags" {
9172
description = "List of tags of instances"
92-
value = local.this_tags
73+
value = aws_instance.this.*.tags
9374
}
9475

9576
output "volume_tags" {
9677
description = "List of tags of volumes of instances"
97-
value = local.this_volume_tags
78+
value = aws_instance.this.*.volume_tags
9879
}

0 commit comments

Comments
 (0)