Registry /
cloud / aws-aws-sdk-go-v2-service-sns
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
sns
✓ github.com/aws/aws-sdk-go-v2/service/sns
List all SNS topics using the AWS SDK v2.
package main
import (
"context"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/sns"
)
func main() {
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
panic(err)
}
client := sns.NewFromConfig(cfg)
result, err := client.ListTopics(context.TODO(), &sns.ListTopicsInput{})
if err != nil {
panic(err)
}
for _, topic := range result.Topics {
println(*topic.TopicArn)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.33.6latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.