Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

312 route 53 default record name #969

Merged
merged 3 commits into from
Feb 12, 2015
Merged

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Feb 12, 2015

First pass at fixing #312.
This will allow AWS Route53 Records to simply specify a subdomain and not the fully qualified name:

Given a zone:

resource "aws_route53_zone" "main" {
  name = "example.com"
}

this change then supports the current:

resource "aws_route53_record" "www" {
  [...]
  name = "www.example.com"
  [...]
}

and shorter:

resource "aws_route53_record" "www" {
  [...]
  name = "www"
  [...]
}

both result in a Route53 record with name www.example.com.

// and keep AWS happy.
recordName := d.Get("name").(string)
zoneName := strings.Trim(zoneRecord.HostedZone.Name, ".")
if ok := strings.HasSuffix(recordName, zoneName); !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you aren't using ok elsewhere, you can just boolean this:

if !strings.HasSuffix(recordName, zoneName) {
  // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pearkes
Copy link
Contributor

pearkes commented Feb 12, 2015

Nice, LGTM!

@ghost
Copy link

ghost commented May 3, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants