Supress diffs for differences in resource_group_name capitalisation.

This commit is contained in:
Andreas Kyrris 2016-09-27 17:15:02 +01:00
parent e589fee01c
commit 82cc9d3e56
2 changed files with 10 additions and 3 deletions

View File

@ -236,3 +236,9 @@ func azureStateRefreshFunc(resourceURI string, client *ArmClient, command rivier
panic(fmt.Errorf("azureStateRefreshFunc called on structure %T with no mapstructure:provisioningState tag. This is a bug", res.Parsed))
}
}
// Resource group names can be capitalised, but we store them in lowercase.
// Use a custom diff function to avoid creation of new resources.
func resourceAzurermResourceGroupNameDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
return strings.ToLower(old) == strings.ToLower(new)
}

View File

@ -33,9 +33,10 @@ func resourceArmStorageAccount() *schema.Resource {
},
"resource_group_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Type: schema.TypeString,
Required: true,
ForceNew: true,
DiffSuppressFunc: resourceAzurermResourceGroupNameDiffSuppress,
},
"location": {