This is a mirror of the official AWS VPC module from github. (Prevents failed clones happening frequently when using github).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

542 lines
17KB

  1. output "vpc_id" {
  2. description = "The ID of the VPC"
  3. value = concat(aws_vpc.this.*.id, [""])[0]
  4. }
  5. output "vpc_arn" {
  6. description = "The ARN of the VPC"
  7. value = concat(aws_vpc.this.*.arn, [""])[0]
  8. }
  9. output "vpc_cidr_block" {
  10. description = "The CIDR block of the VPC"
  11. value = concat(aws_vpc.this.*.cidr_block, [""])[0]
  12. }
  13. output "default_security_group_id" {
  14. description = "The ID of the security group created by default on VPC creation"
  15. value = concat(aws_vpc.this.*.default_security_group_id, [""])[0]
  16. }
  17. output "default_network_acl_id" {
  18. description = "The ID of the default network ACL"
  19. value = concat(aws_vpc.this.*.default_network_acl_id, [""])[0]
  20. }
  21. output "default_route_table_id" {
  22. description = "The ID of the default route table"
  23. value = concat(aws_vpc.this.*.default_route_table_id, [""])[0]
  24. }
  25. output "vpc_instance_tenancy" {
  26. description = "Tenancy of instances spin up within VPC"
  27. value = concat(aws_vpc.this.*.instance_tenancy, [""])[0]
  28. }
  29. output "vpc_enable_dns_support" {
  30. description = "Whether or not the VPC has DNS support"
  31. value = concat(aws_vpc.this.*.enable_dns_support, [""])[0]
  32. }
  33. output "vpc_enable_dns_hostnames" {
  34. description = "Whether or not the VPC has DNS hostname support"
  35. value = concat(aws_vpc.this.*.enable_dns_hostnames, [""])[0]
  36. }
  37. output "vpc_main_route_table_id" {
  38. description = "The ID of the main route table associated with this VPC"
  39. value = concat(aws_vpc.this.*.main_route_table_id, [""])[0]
  40. }
  41. output "vpc_ipv6_association_id" {
  42. description = "The association ID for the IPv6 CIDR block"
  43. value = concat(aws_vpc.this.*.ipv6_association_id, [""])[0]
  44. }
  45. output "vpc_ipv6_cidr_block" {
  46. description = "The IPv6 CIDR block"
  47. value = concat(aws_vpc.this.*.ipv6_cidr_block, [""])[0]
  48. }
  49. output "vpc_secondary_cidr_blocks" {
  50. description = "List of secondary CIDR blocks of the VPC"
  51. value = aws_vpc_ipv4_cidr_block_association.this.*.cidr_block
  52. }
  53. output "vpc_owner_id" {
  54. description = "The ID of the AWS account that owns the VPC"
  55. value = concat(aws_vpc.this.*.owner_id, [""])[0]
  56. }
  57. output "private_subnets" {
  58. description = "List of IDs of private subnets"
  59. value = aws_subnet.private.*.id
  60. }
  61. output "private_subnet_arns" {
  62. description = "List of ARNs of private subnets"
  63. value = aws_subnet.private.*.arn
  64. }
  65. output "private_subnets_cidr_blocks" {
  66. description = "List of cidr_blocks of private subnets"
  67. value = aws_subnet.private.*.cidr_block
  68. }
  69. output "private_subnets_ipv6_cidr_blocks" {
  70. description = "List of IPv6 cidr_blocks of private subnets in an IPv6 enabled VPC"
  71. value = aws_subnet.private.*.ipv6_cidr_block
  72. }
  73. output "public_subnets" {
  74. description = "List of IDs of public subnets"
  75. value = aws_subnet.public.*.id
  76. }
  77. output "public_subnet_arns" {
  78. description = "List of ARNs of public subnets"
  79. value = aws_subnet.public.*.arn
  80. }
  81. output "public_subnets_cidr_blocks" {
  82. description = "List of cidr_blocks of public subnets"
  83. value = aws_subnet.public.*.cidr_block
  84. }
  85. output "public_subnets_ipv6_cidr_blocks" {
  86. description = "List of IPv6 cidr_blocks of public subnets in an IPv6 enabled VPC"
  87. value = aws_subnet.public.*.ipv6_cidr_block
  88. }
  89. output "outpost_subnets" {
  90. description = "List of IDs of outpost subnets"
  91. value = aws_subnet.outpost.*.id
  92. }
  93. output "outpost_subnet_arns" {
  94. description = "List of ARNs of outpost subnets"
  95. value = aws_subnet.outpost.*.arn
  96. }
  97. output "outpost_subnets_cidr_blocks" {
  98. description = "List of cidr_blocks of outpost subnets"
  99. value = aws_subnet.outpost.*.cidr_block
  100. }
  101. output "outpost_subnets_ipv6_cidr_blocks" {
  102. description = "List of IPv6 cidr_blocks of outpost subnets in an IPv6 enabled VPC"
  103. value = aws_subnet.outpost.*.ipv6_cidr_block
  104. }
  105. output "database_subnets" {
  106. description = "List of IDs of database subnets"
  107. value = aws_subnet.database.*.id
  108. }
  109. output "database_subnet_arns" {
  110. description = "List of ARNs of database subnets"
  111. value = aws_subnet.database.*.arn
  112. }
  113. output "database_subnets_cidr_blocks" {
  114. description = "List of cidr_blocks of database subnets"
  115. value = aws_subnet.database.*.cidr_block
  116. }
  117. output "database_subnets_ipv6_cidr_blocks" {
  118. description = "List of IPv6 cidr_blocks of database subnets in an IPv6 enabled VPC"
  119. value = aws_subnet.database.*.ipv6_cidr_block
  120. }
  121. output "database_subnet_group" {
  122. description = "ID of database subnet group"
  123. value = concat(aws_db_subnet_group.database.*.id, [""])[0]
  124. }
  125. output "database_subnet_group_name" {
  126. description = "Name of database subnet group"
  127. value = concat(aws_db_subnet_group.database.*.name, [""])[0]
  128. }
  129. output "redshift_subnets" {
  130. description = "List of IDs of redshift subnets"
  131. value = aws_subnet.redshift.*.id
  132. }
  133. output "redshift_subnet_arns" {
  134. description = "List of ARNs of redshift subnets"
  135. value = aws_subnet.redshift.*.arn
  136. }
  137. output "redshift_subnets_cidr_blocks" {
  138. description = "List of cidr_blocks of redshift subnets"
  139. value = aws_subnet.redshift.*.cidr_block
  140. }
  141. output "redshift_subnets_ipv6_cidr_blocks" {
  142. description = "List of IPv6 cidr_blocks of redshift subnets in an IPv6 enabled VPC"
  143. value = aws_subnet.redshift.*.ipv6_cidr_block
  144. }
  145. output "redshift_subnet_group" {
  146. description = "ID of redshift subnet group"
  147. value = concat(aws_redshift_subnet_group.redshift.*.id, [""])[0]
  148. }
  149. output "elasticache_subnets" {
  150. description = "List of IDs of elasticache subnets"
  151. value = aws_subnet.elasticache.*.id
  152. }
  153. output "elasticache_subnet_arns" {
  154. description = "List of ARNs of elasticache subnets"
  155. value = aws_subnet.elasticache.*.arn
  156. }
  157. output "elasticache_subnets_cidr_blocks" {
  158. description = "List of cidr_blocks of elasticache subnets"
  159. value = aws_subnet.elasticache.*.cidr_block
  160. }
  161. output "elasticache_subnets_ipv6_cidr_blocks" {
  162. description = "List of IPv6 cidr_blocks of elasticache subnets in an IPv6 enabled VPC"
  163. value = aws_subnet.elasticache.*.ipv6_cidr_block
  164. }
  165. output "intra_subnets" {
  166. description = "List of IDs of intra subnets"
  167. value = aws_subnet.intra.*.id
  168. }
  169. output "intra_subnet_arns" {
  170. description = "List of ARNs of intra subnets"
  171. value = aws_subnet.intra.*.arn
  172. }
  173. output "intra_subnets_cidr_blocks" {
  174. description = "List of cidr_blocks of intra subnets"
  175. value = aws_subnet.intra.*.cidr_block
  176. }
  177. output "intra_subnets_ipv6_cidr_blocks" {
  178. description = "List of IPv6 cidr_blocks of intra subnets in an IPv6 enabled VPC"
  179. value = aws_subnet.intra.*.ipv6_cidr_block
  180. }
  181. output "elasticache_subnet_group" {
  182. description = "ID of elasticache subnet group"
  183. value = concat(aws_elasticache_subnet_group.elasticache.*.id, [""])[0]
  184. }
  185. output "elasticache_subnet_group_name" {
  186. description = "Name of elasticache subnet group"
  187. value = concat(aws_elasticache_subnet_group.elasticache.*.name, [""])[0]
  188. }
  189. output "public_route_table_ids" {
  190. description = "List of IDs of public route tables"
  191. value = aws_route_table.public.*.id
  192. }
  193. output "private_route_table_ids" {
  194. description = "List of IDs of private route tables"
  195. value = aws_route_table.private.*.id
  196. }
  197. output "database_route_table_ids" {
  198. description = "List of IDs of database route tables"
  199. value = length(aws_route_table.database.*.id) > 0 ? aws_route_table.database.*.id : aws_route_table.private.*.id
  200. }
  201. output "redshift_route_table_ids" {
  202. description = "List of IDs of redshift route tables"
  203. value = length(aws_route_table.redshift.*.id) > 0 ? aws_route_table.redshift.*.id : aws_route_table.private.*.id
  204. }
  205. output "elasticache_route_table_ids" {
  206. description = "List of IDs of elasticache route tables"
  207. value = length(aws_route_table.elasticache.*.id) > 0 ? aws_route_table.elasticache.*.id : aws_route_table.private.*.id
  208. }
  209. output "intra_route_table_ids" {
  210. description = "List of IDs of intra route tables"
  211. value = aws_route_table.intra.*.id
  212. }
  213. output "public_internet_gateway_route_id" {
  214. description = "ID of the internet gateway route."
  215. value = concat(aws_route.public_internet_gateway.*.id, [""])[0]
  216. }
  217. output "public_internet_gateway_ipv6_route_id" {
  218. description = "ID of the IPv6 internet gateway route."
  219. value = concat(aws_route.public_internet_gateway_ipv6.*.id, [""])[0]
  220. }
  221. output "database_internet_gateway_route_id" {
  222. description = "ID of the database internet gateway route."
  223. value = concat(aws_route.database_internet_gateway.*.id, [""])[0]
  224. }
  225. output "database_nat_gateway_route_ids" {
  226. description = "List of IDs of the database nat gateway route."
  227. value = aws_route.database_nat_gateway.*.id
  228. }
  229. output "database_ipv6_egress_route_id" {
  230. description = "ID of the database IPv6 egress route."
  231. value = concat(aws_route.database_ipv6_egress.*.id, [""])[0]
  232. }
  233. output "private_nat_gateway_route_ids" {
  234. description = "List of IDs of the private nat gateway route."
  235. value = aws_route.private_nat_gateway.*.id
  236. }
  237. output "private_ipv6_egress_route_ids" {
  238. description = "List of IDs of the ipv6 egress route."
  239. value = aws_route.private_ipv6_egress.*.id
  240. }
  241. output "private_route_table_association_ids" {
  242. description = "List of IDs of the private route table association"
  243. value = aws_route_table_association.private.*.id
  244. }
  245. output "database_route_table_association_ids" {
  246. description = "List of IDs of the database route table association"
  247. value = aws_route_table_association.database.*.id
  248. }
  249. output "redshift_route_table_association_ids" {
  250. description = "List of IDs of the redshift route table association"
  251. value = aws_route_table_association.redshift.*.id
  252. }
  253. output "redshift_public_route_table_association_ids" {
  254. description = "List of IDs of the public redshidt route table association"
  255. value = aws_route_table_association.redshift_public.*.id
  256. }
  257. output "elasticache_route_table_association_ids" {
  258. description = "List of IDs of the elasticache route table association"
  259. value = aws_route_table_association.elasticache.*.id
  260. }
  261. output "intra_route_table_association_ids" {
  262. description = "List of IDs of the intra route table association"
  263. value = aws_route_table_association.intra.*.id
  264. }
  265. output "public_route_table_association_ids" {
  266. description = "List of IDs of the public route table association"
  267. value = aws_route_table_association.public.*.id
  268. }
  269. output "nat_ids" {
  270. description = "List of allocation ID of Elastic IPs created for AWS NAT Gateway"
  271. value = aws_eip.nat.*.id
  272. }
  273. output "nat_public_ips" {
  274. description = "List of public Elastic IPs created for AWS NAT Gateway"
  275. value = var.reuse_nat_ips ? var.external_nat_ips : aws_eip.nat.*.public_ip
  276. }
  277. output "natgw_ids" {
  278. description = "List of NAT Gateway IDs"
  279. value = aws_nat_gateway.this.*.id
  280. }
  281. output "igw_id" {
  282. description = "The ID of the Internet Gateway"
  283. value = concat(aws_internet_gateway.this.*.id, [""])[0]
  284. }
  285. output "igw_arn" {
  286. description = "The ARN of the Internet Gateway"
  287. value = concat(aws_internet_gateway.this.*.arn, [""])[0]
  288. }
  289. output "egress_only_internet_gateway_id" {
  290. description = "The ID of the egress only Internet Gateway"
  291. value = concat(aws_egress_only_internet_gateway.this.*.id, [""])[0]
  292. }
  293. output "cgw_ids" {
  294. description = "List of IDs of Customer Gateway"
  295. value = [for k, v in aws_customer_gateway.this : v.id]
  296. }
  297. output "cgw_arns" {
  298. description = "List of ARNs of Customer Gateway"
  299. value = [for k, v in aws_customer_gateway.this : v.arn]
  300. }
  301. output "this_customer_gateway" {
  302. description = "Map of Customer Gateway attributes"
  303. value = aws_customer_gateway.this
  304. }
  305. output "vgw_id" {
  306. description = "The ID of the VPN Gateway"
  307. value = concat(aws_vpn_gateway.this.*.id, aws_vpn_gateway_attachment.this.*.vpn_gateway_id, [""])[0]
  308. }
  309. output "vgw_arn" {
  310. description = "The ARN of the VPN Gateway"
  311. value = concat(aws_vpn_gateway.this.*.arn, [""])[0]
  312. }
  313. output "default_vpc_id" {
  314. description = "The ID of the Default VPC"
  315. value = concat(aws_default_vpc.this.*.id, [""])[0]
  316. }
  317. output "default_vpc_arn" {
  318. description = "The ARN of the Default VPC"
  319. value = concat(aws_default_vpc.this.*.arn, [""])[0]
  320. }
  321. output "default_vpc_cidr_block" {
  322. description = "The CIDR block of the Default VPC"
  323. value = concat(aws_default_vpc.this.*.cidr_block, [""])[0]
  324. }
  325. output "default_vpc_default_security_group_id" {
  326. description = "The ID of the security group created by default on Default VPC creation"
  327. value = concat(aws_default_vpc.this.*.default_security_group_id, [""])[0]
  328. }
  329. output "default_vpc_default_network_acl_id" {
  330. description = "The ID of the default network ACL of the Default VPC"
  331. value = concat(aws_default_vpc.this.*.default_network_acl_id, [""])[0]
  332. }
  333. output "default_vpc_default_route_table_id" {
  334. description = "The ID of the default route table of the Default VPC"
  335. value = concat(aws_default_vpc.this.*.default_route_table_id, [""])[0]
  336. }
  337. output "default_vpc_instance_tenancy" {
  338. description = "Tenancy of instances spin up within Default VPC"
  339. value = concat(aws_default_vpc.this.*.instance_tenancy, [""])[0]
  340. }
  341. output "default_vpc_enable_dns_support" {
  342. description = "Whether or not the Default VPC has DNS support"
  343. value = concat(aws_default_vpc.this.*.enable_dns_support, [""])[0]
  344. }
  345. output "default_vpc_enable_dns_hostnames" {
  346. description = "Whether or not the Default VPC has DNS hostname support"
  347. value = concat(aws_default_vpc.this.*.enable_dns_hostnames, [""])[0]
  348. }
  349. output "default_vpc_main_route_table_id" {
  350. description = "The ID of the main route table associated with the Default VPC"
  351. value = concat(aws_default_vpc.this.*.main_route_table_id, [""])[0]
  352. }
  353. output "public_network_acl_id" {
  354. description = "ID of the public network ACL"
  355. value = concat(aws_network_acl.public.*.id, [""])[0]
  356. }
  357. output "public_network_acl_arn" {
  358. description = "ARN of the public network ACL"
  359. value = concat(aws_network_acl.public.*.arn, [""])[0]
  360. }
  361. output "private_network_acl_id" {
  362. description = "ID of the private network ACL"
  363. value = concat(aws_network_acl.private.*.id, [""])[0]
  364. }
  365. output "private_network_acl_arn" {
  366. description = "ARN of the private network ACL"
  367. value = concat(aws_network_acl.private.*.arn, [""])[0]
  368. }
  369. output "outpost_network_acl_id" {
  370. description = "ID of the outpost network ACL"
  371. value = concat(aws_network_acl.outpost.*.id, [""])[0]
  372. }
  373. output "outpost_network_acl_arn" {
  374. description = "ARN of the outpost network ACL"
  375. value = concat(aws_network_acl.outpost.*.arn, [""])[0]
  376. }
  377. output "intra_network_acl_id" {
  378. description = "ID of the intra network ACL"
  379. value = concat(aws_network_acl.intra.*.id, [""])[0]
  380. }
  381. output "intra_network_acl_arn" {
  382. description = "ARN of the intra network ACL"
  383. value = concat(aws_network_acl.intra.*.arn, [""])[0]
  384. }
  385. output "database_network_acl_id" {
  386. description = "ID of the database network ACL"
  387. value = concat(aws_network_acl.database.*.id, [""])[0]
  388. }
  389. output "database_network_acl_arn" {
  390. description = "ARN of the database network ACL"
  391. value = concat(aws_network_acl.database.*.arn, [""])[0]
  392. }
  393. output "redshift_network_acl_id" {
  394. description = "ID of the redshift network ACL"
  395. value = concat(aws_network_acl.redshift.*.id, [""])[0]
  396. }
  397. output "redshift_network_acl_arn" {
  398. description = "ARN of the redshift network ACL"
  399. value = concat(aws_network_acl.redshift.*.arn, [""])[0]
  400. }
  401. output "elasticache_network_acl_id" {
  402. description = "ID of the elasticache network ACL"
  403. value = concat(aws_network_acl.elasticache.*.id, [""])[0]
  404. }
  405. output "elasticache_network_acl_arn" {
  406. description = "ARN of the elasticache network ACL"
  407. value = concat(aws_network_acl.elasticache.*.arn, [""])[0]
  408. }
  409. # VPC flow log
  410. output "vpc_flow_log_id" {
  411. description = "The ID of the Flow Log resource"
  412. value = concat(aws_flow_log.this.*.id, [""])[0]
  413. }
  414. output "vpc_flow_log_destination_arn" {
  415. description = "The ARN of the destination for VPC Flow Logs"
  416. value = local.flow_log_destination_arn
  417. }
  418. output "vpc_flow_log_destination_type" {
  419. description = "The type of the destination for VPC Flow Logs"
  420. value = var.flow_log_destination_type
  421. }
  422. output "vpc_flow_log_cloudwatch_iam_role_arn" {
  423. description = "The ARN of the IAM role used when pushing logs to Cloudwatch log group"
  424. value = local.flow_log_iam_role_arn
  425. }
  426. # Static values (arguments)
  427. output "azs" {
  428. description = "A list of availability zones specified as argument to this module"
  429. value = var.azs
  430. }
  431. output "name" {
  432. description = "The name of the VPC specified as argument to this module"
  433. value = var.name
  434. }