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

provider/aws: Fix issue with Route 53 and pre-existing, external Hosted zones #1415

Merged
merged 1 commit into from
Apr 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func resourceAwsRoute53Record() *schema.Resource {

func resourceAwsRoute53RecordCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).r53conn
zone := d.Get("zone_id").(string)
zone := cleanZoneID(d.Get("zone_id").(string))

zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(zone)})
if err != nil {
Expand Down Expand Up @@ -151,7 +151,7 @@ func resourceAwsRoute53RecordCreate(d *schema.ResourceData, meta interface{}) er
func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).r53conn

zone := d.Get("zone_id").(string)
zone := cleanZoneID(d.Get("zone_id").(string))

// get expanded name
zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(zone)})
Expand Down Expand Up @@ -200,7 +200,7 @@ func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) erro
func resourceAwsRoute53RecordDelete(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).r53conn

zone := d.Get("zone_id").(string)
zone := cleanZoneID(d.Get("zone_id").(string))
log.Printf("[DEBUG] Deleting resource records for zone: %s, name: %s",
zone, d.Get("name").(string))
zoneRecord, err := conn.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(zone)})
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_route53_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ resource "aws_route53_zone" "main" {
}

resource "aws_route53_record" "default" {
zone_id = "${aws_route53_zone.main.zone_id}"
zone_id = "/hostedzone/${aws_route53_zone.main.zone_id}"
name = "subdomain"
type = "TXT"
ttl = "30"
Expand Down