Guest User

Untitled

a guest
May 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. # Set up the load balancer
  2. resource "aws_alb" "example" {
  3. name = "example"
  4. internal = false
  5. security_groups = ["${aws_security_group.example.id}"]
  6. subnets = ["${data.aws_subnet_ids.example.ids}"]
  7. }
  8.  
  9. # Get the zone id for the zone you are setting this in
  10. data "aws_route53_zone" "example" {
  11. name = "example.com"
  12. private_zone = false
  13. }
  14.  
  15. # Set the record, replace <your dns name> with the name you want to use
  16. resource "aws_route53_record" "build" {
  17. provider = "aws"
  18. zone_id = "${data.aws_route53_zone.example.zone_id}"
  19. name = "<your dns name>"
  20. type = "A"
  21.  
  22. alias {
  23. name = "${aws_alb.example.dns_name}"
  24. zone_id = "${aws_alb.eaxmple.zone_id}"
  25. evaluate_target_health = false
  26. }
  27. }
Add Comment
Please, Sign In to add comment