Skip to content

Instantly share code, notes, and snippets.

@calum-github
Created February 28, 2019 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calum-github/6ea1c80d31568dcd114367e864c3f3f1 to your computer and use it in GitHub Desktop.
Save calum-github/6ea1c80d31568dcd114367e864c3f3f1 to your computer and use it in GitHub Desktop.
Route53 Terraform example
// Manage DNS
// Create a private route53 zone
resource "aws_route53_zone" "this" {
name = "${var.dns_zone_name}"
vpc_id = "${var.vpc_id}"
}
// Create a dns record for the jenkins master private ip
resource "aws_route53_record" "master" {
zone_id = "${aws_route53_zone.this.id}"
name = "master01.${aws_route53_zone.this.name}"
type = "A"
ttl = "300"
records = ["${aws_instance.jenkins_master_01.private_ip}"]
}
// Create a dns record for the build slave private ip
resource "aws_route53_record" "slave" {
zone_id = "${aws_route53_zone.this.id}"
name = "slave01.${aws_route53_zone.this.name}"
type = "A"
ttl = "300"
records = ["${aws_instance.jenkins_build_slave_01.private_ip}"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment