Skip to content

Commit

Permalink
Merge pull request #24603 from hashicorp/t-sns-remove-service
Browse files Browse the repository at this point in the history
sns: Remove service from funcs
  • Loading branch information
YakDriver authored May 5, 2022
2 parents 38f3e35 + 16c87ef commit 36dc508
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/service/sns/topic_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func resourceTopicPolicyDelete(d *schema.ResourceData, meta interface{}) error {
// It is impossible to delete a policy or set to empty
// (confirmed by AWS Support representative)
// so we instead set it back to the default one.
err := putTopicPolicy(conn, d.Id(), defaultSNSTopicPolicy(d.Id(), d.Get("owner").(string)))
err := putTopicPolicy(conn, d.Id(), defaultTopicPolicy(d.Id(), d.Get("owner").(string)))

if err != nil {
return err
Expand All @@ -126,7 +126,7 @@ func resourceTopicPolicyDelete(d *schema.ResourceData, meta interface{}) error {
return nil
}

func defaultSNSTopicPolicy(topicArn, accountId string) string {
func defaultTopicPolicy(topicArn, accountId string) string {
return fmt.Sprintf(`{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
Expand Down
6 changes: 3 additions & 3 deletions internal/service/sns/topic_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ type TopicSubscriptionRedrivePolicy struct {
}

func SuppressEquivalentTopicSubscriptionDeliveryPolicy(k, old, new string, d *schema.ResourceData) bool {
ob, err := normalizeSnsTopicSubscriptionDeliveryPolicy(old)
ob, err := normalizeTopicSubscriptionDeliveryPolicy(old)
if err != nil {
log.Print(err)
return false
}

nb, err := normalizeSnsTopicSubscriptionDeliveryPolicy(new)
nb, err := normalizeTopicSubscriptionDeliveryPolicy(new)
if err != nil {
log.Print(err)
return false
Expand All @@ -373,7 +373,7 @@ func SuppressEquivalentTopicSubscriptionDeliveryPolicy(k, old, new string, d *sc
return verify.JSONBytesEqual(ob, nb)
}

func normalizeSnsTopicSubscriptionDeliveryPolicy(policy string) ([]byte, error) {
func normalizeTopicSubscriptionDeliveryPolicy(policy string) ([]byte, error) {
var deliveryPolicy TopicSubscriptionDeliveryPolicy

if err := json.Unmarshal([]byte(policy), &deliveryPolicy); err != nil {
Expand Down

0 comments on commit 36dc508

Please sign in to comment.