providers/aws: route53_zone id-only refresh
This commit is contained in:
parent
8b4e98e732
commit
b1c215f5e2
|
@ -138,6 +138,14 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error
|
|||
return err
|
||||
}
|
||||
|
||||
// In the import case this will be empty
|
||||
if _, ok := d.GetOk("zone_id"); !ok {
|
||||
d.Set("zone_id", d.Id())
|
||||
}
|
||||
if _, ok := d.GetOk("name"); !ok {
|
||||
d.Set("name", zone.HostedZone.Name)
|
||||
}
|
||||
|
||||
if !*zone.HostedZone.Config.PrivateZone {
|
||||
ns := make([]string, len(zone.DelegationSet.NameServers))
|
||||
for i := range zone.DelegationSet.NameServers {
|
||||
|
|
|
@ -70,6 +70,7 @@ func TestAccAWSRoute53Zone_basic(t *testing.T) {
|
|||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
IDRefreshName: "aws_route53_zone.main",
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
|
@ -91,6 +92,7 @@ func TestAccAWSRoute53Zone_updateComment(t *testing.T) {
|
|||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
IDRefreshName: "aws_route53_zone.main",
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
|
@ -123,6 +125,7 @@ func TestAccAWSRoute53Zone_private_basic(t *testing.T) {
|
|||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
IDRefreshName: "aws_route53_zone.main",
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
|
@ -153,6 +156,7 @@ func TestAccAWSRoute53Zone_private_region(t *testing.T) {
|
|||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
IDRefreshName: "aws_route53_zone.main",
|
||||
ProviderFactories: providerFactories,
|
||||
CheckDestroy: testAccCheckRoute53ZoneDestroyWithProviders(&providers),
|
||||
Steps: []resource.TestStep{
|
||||
|
@ -310,7 +314,7 @@ func testAccLoadTagsR53(zone *route53.GetHostedZoneOutput, td *route53.ResourceT
|
|||
|
||||
const testAccRoute53ZoneConfig = `
|
||||
resource "aws_route53_zone" "main" {
|
||||
name = "hashicorp.com"
|
||||
name = "hashicorp.com."
|
||||
comment = "Custom comment"
|
||||
|
||||
tags {
|
||||
|
@ -322,7 +326,7 @@ resource "aws_route53_zone" "main" {
|
|||
|
||||
const testAccRoute53ZoneConfigUpdateComment = `
|
||||
resource "aws_route53_zone" "main" {
|
||||
name = "hashicorp.com"
|
||||
name = "hashicorp.com."
|
||||
comment = "Change Custom Comment"
|
||||
|
||||
tags {
|
||||
|
@ -341,7 +345,7 @@ resource "aws_vpc" "main" {
|
|||
}
|
||||
|
||||
resource "aws_route53_zone" "main" {
|
||||
name = "hashicorp.com"
|
||||
name = "hashicorp.com."
|
||||
vpc_id = "${aws_vpc.main.id}"
|
||||
}
|
||||
`
|
||||
|
@ -367,7 +371,7 @@ resource "aws_vpc" "main" {
|
|||
|
||||
resource "aws_route53_zone" "main" {
|
||||
provider = "aws.west"
|
||||
name = "hashicorp.com"
|
||||
name = "hashicorp.com."
|
||||
vpc_id = "${aws_vpc.main.id}"
|
||||
vpc_region = "us-east-1"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue