provider/aws: Use helper methods for checking partition

This commit is contained in:
Jake Champlin 2017-05-09 12:17:27 -04:00
parent 8d91080af8
commit 19e29c2944
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
1 changed files with 4 additions and 2 deletions

View File

@ -109,7 +109,7 @@ func resourceAwsCloudWatchLogGroupRead(d *schema.ResourceData, meta interface{})
d.Set("retention_in_days", lg.RetentionInDays)
}
if meta.(*AWSClient).partition != "aws-us-gov" {
if meta.(*AWSClient).IsChinaCloud() || meta.(*AWSClient).IsGovCloud() {
tags, err := flattenCloudWatchTags(d, conn)
if err != nil {
return err
@ -172,7 +172,9 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{
}
}
if meta.(*AWSClient).partition != "aws-us-gov" && d.HasChange("tags") {
restricted := meta.(*AWSClient).IsChinaCloud() || meta.(*AWSClient).IsGovCloud()
if !restricted && d.HasChange("tags") {
oraw, nraw := d.GetChange("tags")
o := oraw.(map[string]interface{})
n := nraw.(map[string]interface{})