-
Notifications
You must be signed in to change notification settings - Fork 17
/
TopicPolicyProps.go
37 lines (34 loc) · 980 Bytes
/
TopicPolicyProps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package awssns
import (
"github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
)
// Properties to associate SNS topics with a policy.
//
// Example:
// topic := sns.NewTopic(this, jsii.String("Topic"))
// topicPolicy := sns.NewTopicPolicy(this, jsii.String("TopicPolicy"), &TopicPolicyProps{
// Topics: []iTopic{
// topic,
// },
// })
//
// topicPolicy.Document.AddStatements(iam.NewPolicyStatement(&PolicyStatementProps{
// Actions: []*string{
// jsii.String("sns:Subscribe"),
// },
// Principals: []iPrincipal{
// iam.NewAnyPrincipal(),
// },
// Resources: []*string{
// topic.TopicArn,
// },
// }))
//
type TopicPolicyProps struct {
// The set of topics this policy applies to.
Topics *[]ITopic `field:"required" json:"topics" yaml:"topics"`
// IAM policy document to apply to topic(s).
// Default: empty policy document.
//
PolicyDocument awsiam.PolicyDocument `field:"optional" json:"policyDocument" yaml:"policyDocument"`
}