main.tf 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. resource "aws_customer_gateway" "attachment" {
  2. count = var.interconnects_count
  3. bgp_asn = var.interconnect_asn
  4. ip_address = var.interconnect_public_ips[count.index]
  5. type = "ipsec.1"
  6. tags = merge(var.standard_tags, var.tags)
  7. }
  8. resource "aws_vpn_connection" "vpn" {
  9. count = var.interconnects_count
  10. customer_gateway_id = aws_customer_gateway.attachment[count.index].id
  11. transit_gateway_id = var.transit_gateway_id
  12. type = aws_customer_gateway.attachment[count.index].type
  13. tags = merge(var.standard_tags, var.tags)
  14. # The following settings (and more) originally could not be configured. We may want to revisit to see
  15. # if these things should be hardened, but they look strong to me already.
  16. tunnel1_ike_versions = [ "ikev2", ]
  17. tunnel1_phase1_dh_group_numbers = [ 15, 16, 17, ]
  18. tunnel1_phase1_encryption_algorithms = [ "AES256", ]
  19. tunnel1_phase1_integrity_algorithms = [ "SHA2-256", ]
  20. tunnel1_phase2_dh_group_numbers = [ 15, 16, 17, ]
  21. tunnel1_phase2_encryption_algorithms = [ "AES256", ]
  22. tunnel1_phase2_integrity_algorithms = [ "SHA2-256", ]
  23. tunnel2_ike_versions = [ "ikev2", ]
  24. tunnel2_phase1_dh_group_numbers = [ 15, 16, 17, ]
  25. tunnel2_phase1_encryption_algorithms = [ "AES256", ]
  26. tunnel2_phase1_integrity_algorithms = [ "SHA2-256", ]
  27. tunnel2_phase2_dh_group_numbers = [ 15, 16, 17, ]
  28. tunnel2_phase2_encryption_algorithms = [ "AES256", ]
  29. tunnel2_phase2_integrity_algorithms = [ "SHA2-256", ]
  30. }