fix doc, add aws permissions for sns topics
parent
740b872e01
commit
dad6bbff73
|
@ -130,6 +130,9 @@ As AWS documentation recommends, the below policy is granting only the permissio
|
|||
"sqs:GetQueueAttributes",
|
||||
"sqs:ListQueueTags",
|
||||
"sqs:ListQueues"
|
||||
"sns:ListTopics",
|
||||
"sns:GetTopicAttributes",
|
||||
"sns:ListTagsForResource"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -245,3 +248,10 @@ As AWS documentation recommends, the below policy is granting only the permissio
|
|||
|
||||
- [x] aws_sqs_queue
|
||||
- [x] aws_sqs_queue_policy
|
||||
|
||||
## SNS
|
||||
- [x] aws_sns_topic
|
||||
- [ ] aws_sns_topic_policy
|
||||
- [ ] aws_sns_topic_subscription
|
||||
- [ ] aws_sns_platform_application
|
||||
- [ ] aws_sns_sms_preferences
|
||||
|
|
|
@ -10,17 +10,17 @@ type SNSRepository interface {
|
|||
ListAllTopics() ([]*sns.Topic, error)
|
||||
}
|
||||
|
||||
type snsRepositoryImpl struct {
|
||||
type snsRepository struct {
|
||||
client snsiface.SNSAPI
|
||||
}
|
||||
|
||||
func NewSNSClient(session *session.Session) *snsRepositoryImpl {
|
||||
return &snsRepositoryImpl{
|
||||
func NewSNSClient(session *session.Session) *snsRepository {
|
||||
return &snsRepository{
|
||||
sns.New(session),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *snsRepositoryImpl) ListAllTopics() ([]*sns.Topic, error) {
|
||||
func (r *snsRepository) ListAllTopics() ([]*sns.Topic, error) {
|
||||
var topics []*sns.Topic
|
||||
input := &sns.ListTopicsInput{}
|
||||
err := r.client.ListTopicsPages(input, func(res *sns.ListTopicsOutput, lastPage bool) bool {
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
"github.com/aws/aws-sdk-go/service/sns"
|
||||
)
|
||||
|
||||
func Test_snsRepositoryImpl_ListAllTopics(t *testing.T) {
|
||||
func Test_snsRepository_ListAllTopics(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -60,7 +60,7 @@ func Test_snsRepositoryImpl_ListAllTopics(t *testing.T) {
|
|||
t.Run(tt.name, func(t *testing.T) {
|
||||
client := &mocks.SNSClient{}
|
||||
tt.mocks(client)
|
||||
r := &snsRepositoryImpl{
|
||||
r := &snsRepository{
|
||||
client: client,
|
||||
}
|
||||
got, err := r.ListAllTopics()
|
||||
|
|
Loading…
Reference in New Issue