outputs.tf 571 B

123456789101112131415161718192021222324
  1. # The module contract (design section 5): id, ip_range, name.
  2. output "id" {
  3. value = aws_vpc.this.id
  4. }
  5. output "ip_range" {
  6. value = aws_vpc.this.cidr_block
  7. }
  8. output "name" {
  9. value = local.name
  10. }
  11. # AWS extension: machines launch into a subnet, not into the VPC itself.
  12. output "subnet_id" {
  13. value = aws_subnet.public.id
  14. # A subnet is only usable once its route table sends traffic to the gateway,
  15. # so a consumer in the same apply waits for the route and the association.
  16. depends_on = [
  17. aws_route.internet,
  18. aws_route_table_association.public,
  19. ]
  20. }