Fix import of resource group name for azurerm_sql_firewall_rule.

This commit is contained in:
Andreas Kyrris 2016-09-28 11:05:45 +01:00
parent 48055158b6
commit b2f85a766c
2 changed files with 8 additions and 1 deletions

View File

@ -27,7 +27,7 @@ func TestAccAzureRMSqlFirewallRule_importBasic(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"resource_group_name", "server_name"},
ImportStateVerifyIgnore: []string{"server_name"},
},
},
})

View File

@ -94,6 +94,12 @@ func resourceArmSqlFirewallRuleCreate(d *schema.ResourceData, meta interface{})
}
func resourceArmSqlFirewallRuleRead(d *schema.ResourceData, meta interface{}) error {
id, err := parseAzureResourceID(d.Id())
if err != nil {
return err
}
resGroup := id.ResourceGroup
client := meta.(*ArmClient)
rivieraClient := client.rivieraClient
@ -112,6 +118,7 @@ func resourceArmSqlFirewallRuleRead(d *schema.ResourceData, meta interface{}) er
resp := readResponse.Parsed.(*sql.GetFirewallRuleResponse)
d.Set("resource_group_name", resGroup)
d.Set("name", resp.Name)
d.Set("start_ip_address", resp.StartIPAddress)
d.Set("end_ip_address", resp.EndIPAddress)