Skip to content

Commit 2f525fd

Browse files
authored
add cache for shield subscription (#2408)
1 parent 1d492cb commit 2f525fd

File tree

6 files changed

+2025
-18
lines changed

6 files changed

+2025
-18
lines changed

pkg/aws/services/shield.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package services
22

33
import (
4-
"context"
54
"github.com/aws/aws-sdk-go/aws"
65
"github.com/aws/aws-sdk-go/aws/session"
76
"github.com/aws/aws-sdk-go/service/shield"
@@ -10,8 +9,6 @@ import (
109

1110
type Shield interface {
1211
shieldiface.ShieldAPI
13-
14-
Available() (bool, error)
1512
}
1613

1714
// NewShield constructs new Shield implementation.
@@ -26,12 +23,3 @@ func NewShield(session *session.Session) Shield {
2623
type defaultShield struct {
2724
shieldiface.ShieldAPI
2825
}
29-
30-
func (c *defaultShield) Available() (bool, error) {
31-
req := &shield.GetSubscriptionStateInput{}
32-
resp, err := c.GetSubscriptionStateWithContext(context.Background(), req)
33-
if err != nil {
34-
return false, err
35-
}
36-
return *resp.SubscriptionState == "ACTIVE", nil
37-
}

0 commit comments

Comments
 (0)