Skip to content

Commit

Permalink
Merge pull request #19086 from hashicorp/td-resource-update-with-has-…
Browse files Browse the repository at this point in the history
…changes-except-clean-up

resources: addition of "tags_all" to resource `Update` functions using `d.HasChangesExcept("tags"...)` and `d.HasChangeExcept`
  • Loading branch information
anGie44 authored Apr 23, 2021
2 parents a3cb86b + 92acf8a commit 244a32f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aws/resource_aws_ebs_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func resourceAwsEbsVolumeCreate(d *schema.ResourceData, meta interface{}) error
func resourceAWSEbsVolumeUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn

if d.HasChangesExcept("tags") {
if d.HasChangesExcept("tags", "tags_all") {
params := &ec2.ModifyVolumeInput{
VolumeId: aws.String(d.Id()),
}
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_ec2_managed_prefix_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func resourceAwsEc2ManagedPrefixListCreate(d *schema.ResourceData, meta interfac
input.PrefixListName = aws.String(v.(string))
}

if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 {
if len(tags) > 0 {
input.TagSpecifications = ec2TagSpecificationsFromKeyValueTags(tags, "prefix-list")
}

Expand Down Expand Up @@ -209,7 +209,7 @@ func resourceAwsEc2ManagedPrefixListRead(d *schema.ResourceData, meta interface{
func resourceAwsEc2ManagedPrefixListUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn

if d.HasChangeExcept("tags") {
if d.HasChangesExcept("tags", "tags_all") {
input := &ec2.ModifyManagedPrefixListInput{
PrefixListId: aws.String(d.Id()),
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_mwaa_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func resourceAwsMwaaEnvironmentUpdate(d *schema.ResourceData, meta interface{})
Name: aws.String(d.Get("name").(string)),
}

if d.HasChangesExcept("tags") {
if d.HasChangesExcept("tags", "tags_all") {
if d.HasChange("airflow_configuration_options") {
options, ok := d.GetOk("airflow_configuration_options")
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_ssm_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func resourceAwsSsmDocumentUpdate(d *schema.ResourceData, meta interface{}) erro
return nil
}

if d.HasChangesExcept("tags", "permissions") {
if d.HasChangesExcept("tags", "tags_all", "permissions") {
if err := updateAwsSSMDocument(d, meta); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_synthetics_canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func resourceAwsSyntheticsCanaryRead(d *schema.ResourceData, meta interface{}) e
func resourceAwsSyntheticsCanaryUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).syntheticsconn

if d.HasChangesExcept("tags", "start_canary") {
if d.HasChangesExcept("tags", "tags_all", "start_canary") {
input := &synthetics.UpdateCanaryInput{
Name: aws.String(d.Id()),
}
Expand Down

0 comments on commit 244a32f

Please sign in to comment.