Skip to content

Review and improve EC2 DNS code #15

@exequielrafaela

Description

@exequielrafaela

What?

  • Improve EC2 DNS: https://github.com/binbashar/terraform-aws-ec2-basic-layout/blob/master/dns.tf
    • This should be improved to allow the module to accept a list of entries that have the name, zone_id, etc
    • Review that the difference between private and public since it seems not strictly necessary, it can be specified directly by the user of the module with the dns domain to resolve (validate EIP vs private EC2).
dns.tf
resource "aws_route53_record" "main_private" {
  count = length(var.dns_records_internal_hosted_zone) > 0 && var.associate_public_ip_address == true ? length(var.dns_records_internal_hosted_zone) : 0

  zone_id = lookup(element(var.dns_records_internal_hosted_zone, count.index), "zone_id", null)
  name    = lookup(element(var.dns_records_internal_hosted_zone, count.index), "name", null)
Show more
<https://github.com/binbashar/terraform-aws-ec2-basic-layout|binbashar/terraform-aws-ec2-basic-layout>binbashar/terraform-aws-ec2-basic-layout | Added by GitHub

Why?

  • Functionality improvement and code enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions