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.

31 lines
1.0 KiB

  1. #resource "digitalocean_floating_ip" "cluster" {
  2. # droplet_id = "${element(digitalocean_droplet.cluster.*.id,count.index)}"
  3. # region = "${element(digitalocean_droplet.cluster.*.region,count.index)}"
  4. # count = "${var.servers}"
  5. #}
  6. provider "aws" {
  7. }
  8. data "aws_route53_zone" "cluster" {
  9. name = "testnets.interblock.io."
  10. }
  11. resource "aws_route53_record" "cluster-node" {
  12. zone_id = "${data.aws_route53_zone.cluster.zone_id}"
  13. name = "${var.name}-node${count.index}"
  14. type = "A"
  15. ttl = "300"
  16. records = ["${element(digitalocean_droplet.cluster.*.ipv4_address,count.index)}"]
  17. count = "${var.servers}"
  18. }
  19. resource "aws_route53_record" "cluster-regions" {
  20. zone_id = "${data.aws_route53_zone.cluster.zone_id}"
  21. name = "${var.name}-${element(digitalocean_droplet.cluster.*.region,count.index)}"
  22. type = "CNAME"
  23. ttl = "300"
  24. records = ["${element(aws_route53_record.cluster-node.*.name,count.index)}.${data.aws_route53_zone.cluster.name}"]
  25. count = "${var.servers}"
  26. }