Terraform-provider-aws: How to create SRV record in Route53 with Terraform

Created on 17 Oct 2018  ·  3Comments  ·  Source: hashicorp/terraform-provider-aws

Dear support,

I am trying to create SRV record in our AWS account with Terraform but I did not find any guide on it. I found in the DNS Provider branch and it is saying it is not available right now.

Can you let me know if we can do it or not?

Thank you very much.

Regards,

Harvey

question servicroute53

Most helpful comment

The documentation is lacking here. SRV records have special fields that other records do not have. It is not clear at all how to set them.

Fields srv records use: priority, weight, port, target, service, proto, name.

Here is how the value needs to be set:

priority weight port target.

And name:
_service._proto.name.

Maybe this can be added as an example to the docs.

All 3 comments

Hi, @hh2001! 👋 I believe you are looking for the aws_route53_record resource:

resource "aws_route53_record" "example" {
  name    = "_example.${aws_route53_zone.example.name}"
  records = ["example"]
  ttl     = "300"
  type    = "SRV"
  zone_id = "${aws_route53_zone.example.zone_id}"
}

Hopefully this leads you on the right track. 😄

If you have any further questions, I would suggest reaching out on some of the other Terraform community forums where there are many more people watching and able to help. This GitHub issue tracker is only watched by Terraform code maintainers and generally for bug reports or feature requests with the Terraform AWS provider. 👍

The documentation is lacking here. SRV records have special fields that other records do not have. It is not clear at all how to set them.

Fields srv records use: priority, weight, port, target, service, proto, name.

Here is how the value needs to be set:

priority weight port target.

And name:
_service._proto.name.

Maybe this can be added as an example to the docs.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings