Skip to content

Commit c3fd156

Browse files
authored
fix: Compact CIDR block outputs to avoid empty diffs (#802)
1 parent 93ca83a commit c3fd156

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.62.3
3+
rev: v1.72.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.1.0
26+
rev: v4.3.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

outputs.tf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ output "vpc_ipv6_cidr_block" {
6060

6161
output "vpc_secondary_cidr_blocks" {
6262
description = "List of secondary CIDR blocks of the VPC"
63-
value = aws_vpc_ipv4_cidr_block_association.this[*].cidr_block
63+
value = compact(aws_vpc_ipv4_cidr_block_association.this[*].cidr_block)
6464
}
6565

6666
output "vpc_owner_id" {
@@ -80,12 +80,12 @@ output "private_subnet_arns" {
8080

8181
output "private_subnets_cidr_blocks" {
8282
description = "List of cidr_blocks of private subnets"
83-
value = aws_subnet.private[*].cidr_block
83+
value = compact(aws_subnet.private[*].cidr_block)
8484
}
8585

8686
output "private_subnets_ipv6_cidr_blocks" {
8787
description = "List of IPv6 cidr_blocks of private subnets in an IPv6 enabled VPC"
88-
value = aws_subnet.private[*].ipv6_cidr_block
88+
value = compact(aws_subnet.private[*].ipv6_cidr_block)
8989
}
9090

9191
output "public_subnets" {
@@ -100,12 +100,12 @@ output "public_subnet_arns" {
100100

101101
output "public_subnets_cidr_blocks" {
102102
description = "List of cidr_blocks of public subnets"
103-
value = aws_subnet.public[*].cidr_block
103+
value = compact(aws_subnet.public[*].cidr_block)
104104
}
105105

106106
output "public_subnets_ipv6_cidr_blocks" {
107107
description = "List of IPv6 cidr_blocks of public subnets in an IPv6 enabled VPC"
108-
value = aws_subnet.public[*].ipv6_cidr_block
108+
value = compact(aws_subnet.public[*].ipv6_cidr_block)
109109
}
110110

111111
output "outpost_subnets" {
@@ -120,12 +120,12 @@ output "outpost_subnet_arns" {
120120

121121
output "outpost_subnets_cidr_blocks" {
122122
description = "List of cidr_blocks of outpost subnets"
123-
value = aws_subnet.outpost[*].cidr_block
123+
value = compact(aws_subnet.outpost[*].cidr_block)
124124
}
125125

126126
output "outpost_subnets_ipv6_cidr_blocks" {
127127
description = "List of IPv6 cidr_blocks of outpost subnets in an IPv6 enabled VPC"
128-
value = aws_subnet.outpost[*].ipv6_cidr_block
128+
value = compact(aws_subnet.outpost[*].ipv6_cidr_block)
129129
}
130130

131131
output "database_subnets" {
@@ -140,12 +140,12 @@ output "database_subnet_arns" {
140140

141141
output "database_subnets_cidr_blocks" {
142142
description = "List of cidr_blocks of database subnets"
143-
value = aws_subnet.database[*].cidr_block
143+
value = compact(aws_subnet.database[*].cidr_block)
144144
}
145145

146146
output "database_subnets_ipv6_cidr_blocks" {
147147
description = "List of IPv6 cidr_blocks of database subnets in an IPv6 enabled VPC"
148-
value = aws_subnet.database[*].ipv6_cidr_block
148+
value = compact(aws_subnet.database[*].ipv6_cidr_block)
149149
}
150150

151151
output "database_subnet_group" {
@@ -170,12 +170,12 @@ output "redshift_subnet_arns" {
170170

171171
output "redshift_subnets_cidr_blocks" {
172172
description = "List of cidr_blocks of redshift subnets"
173-
value = aws_subnet.redshift[*].cidr_block
173+
value = compact(aws_subnet.redshift[*].cidr_block)
174174
}
175175

176176
output "redshift_subnets_ipv6_cidr_blocks" {
177177
description = "List of IPv6 cidr_blocks of redshift subnets in an IPv6 enabled VPC"
178-
value = aws_subnet.redshift[*].ipv6_cidr_block
178+
value = compact(aws_subnet.redshift[*].ipv6_cidr_block)
179179
}
180180

181181
output "redshift_subnet_group" {
@@ -195,12 +195,12 @@ output "elasticache_subnet_arns" {
195195

196196
output "elasticache_subnets_cidr_blocks" {
197197
description = "List of cidr_blocks of elasticache subnets"
198-
value = aws_subnet.elasticache[*].cidr_block
198+
value = compact(aws_subnet.elasticache[*].cidr_block)
199199
}
200200

201201
output "elasticache_subnets_ipv6_cidr_blocks" {
202202
description = "List of IPv6 cidr_blocks of elasticache subnets in an IPv6 enabled VPC"
203-
value = aws_subnet.elasticache[*].ipv6_cidr_block
203+
value = compact(aws_subnet.elasticache[*].ipv6_cidr_block)
204204
}
205205

206206
output "intra_subnets" {
@@ -215,12 +215,12 @@ output "intra_subnet_arns" {
215215

216216
output "intra_subnets_cidr_blocks" {
217217
description = "List of cidr_blocks of intra subnets"
218-
value = aws_subnet.intra[*].cidr_block
218+
value = compact(aws_subnet.intra[*].cidr_block)
219219
}
220220

221221
output "intra_subnets_ipv6_cidr_blocks" {
222222
description = "List of IPv6 cidr_blocks of intra subnets in an IPv6 enabled VPC"
223-
value = aws_subnet.intra[*].ipv6_cidr_block
223+
value = compact(aws_subnet.intra[*].ipv6_cidr_block)
224224
}
225225

226226
output "elasticache_subnet_group" {

0 commit comments

Comments
 (0)