provider/aws: Rename zone_id to hosted_zone_id in aws_db_instance
Also added a test to prove that the computed value gets set ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_basic' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2016/11/10 06:26:22 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDBInstance_basic -timeout 120m === RUN TestAccAWSDBInstance_basic --- PASS: TestAccAWSDBInstance_basic (634.33s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws634.347s ```
This commit is contained in:
parent
58412762eb
commit
e02960810d
|
@ -236,7 +236,7 @@ func resourceAwsDbInstance() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
|
||||
"zone_id": &schema.Schema{
|
||||
"hosted_zone_id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
@ -674,7 +674,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
|||
if v.Endpoint != nil {
|
||||
d.Set("port", v.Endpoint.Port)
|
||||
d.Set("address", v.Endpoint.Address)
|
||||
d.Set("zone_id", v.Endpoint.HostedZoneId)
|
||||
d.Set("hosted_zone_id", v.Endpoint.HostedZoneId)
|
||||
if v.Endpoint.Address != nil && v.Endpoint.Port != nil {
|
||||
d.Set("endpoint",
|
||||
fmt.Sprintf("%s:%d", *v.Endpoint.Address, *v.Endpoint.Port))
|
||||
|
|
|
@ -46,6 +46,7 @@ func TestAccAWSDBInstance_basic(t *testing.T) {
|
|||
"aws_db_instance.bar", "username", "foo"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"aws_db_instance.bar", "parameter_group_name", "default.mysql5.6"),
|
||||
resource.TestCheckResourceAttrSet("aws_db_instance.bar", "hosted_zone_id"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue