Skip to content

Commit

Permalink
use keyvaluesmap package
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 authored and Ilia Lazebnik committed Oct 10, 2019
1 parent 94a3a9b commit 0de5648
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 233 deletions.
3 changes: 2 additions & 1 deletion aws/resource_aws_waf_rate_based_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/service/waf"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)

func resourceAwsWafRateBasedRule() *schema.Resource {
Expand Down Expand Up @@ -68,7 +69,7 @@ func resourceAwsWafRateBasedRule() *schema.Resource {

func resourceAwsWafRateBasedRuleCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).wafconn
tags := tagsFromMapWAF(d.Get("tags").(map[string]interface{}))
tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags()

wr := newWafRetryer(conn)
out, err := wr.RetryWithToken(func(token *string) (interface{}, error) {
Expand Down
3 changes: 2 additions & 1 deletion aws/resource_aws_waf_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/service/waf"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)

func resourceAwsWafRule() *schema.Resource {
Expand Down Expand Up @@ -62,7 +63,7 @@ func resourceAwsWafRule() *schema.Resource {

func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).wafconn
tags := tagsFromMapWAF(d.Get("tags").(map[string]interface{}))
tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags()

wr := newWafRetryer(conn)
out, err := wr.RetryWithToken(func(token *string) (interface{}, error) {
Expand Down
3 changes: 2 additions & 1 deletion aws/resource_aws_waf_rule_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/waf"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)

func resourceAwsWafRuleGroup() *schema.Resource {
Expand Down Expand Up @@ -72,7 +73,7 @@ func resourceAwsWafRuleGroup() *schema.Resource {

func resourceAwsWafRuleGroupCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).wafconn
tags := tagsFromMapWAF(d.Get("tags").(map[string]interface{}))
tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags()

wr := newWafRetryer(conn)
out, err := wr.RetryWithToken(func(token *string) (interface{}, error) {
Expand Down
118 changes: 0 additions & 118 deletions aws/tagsWAF.go

This file was deleted.

112 changes: 0 additions & 112 deletions aws/tagsWAF_test.go

This file was deleted.

0 comments on commit 0de5648

Please sign in to comment.