Documentation ¶
Index ¶
- func NewEmailSubscription_Override(e EmailSubscription, emailAddress *string, props *EmailSubscriptionProps)
- func NewLambdaSubscription_Override(l LambdaSubscription, fn awslambda.IFunction, props *LambdaSubscriptionProps)
- func NewSmsSubscription_Override(s SmsSubscription, phoneNumber *string, props *SmsSubscriptionProps)
- func NewSqsSubscription_Override(s SqsSubscription, queue awssqs.IQueue, props *SqsSubscriptionProps)
- func NewUrlSubscription_Override(u UrlSubscription, url *string, props *UrlSubscriptionProps)
- type EmailSubscription
- type EmailSubscriptionProps
- type LambdaSubscription
- type LambdaSubscriptionProps
- type SmsSubscription
- type SmsSubscriptionProps
- type SqsSubscription
- type SqsSubscriptionProps
- type SubscriptionProps
- type UrlSubscription
- type UrlSubscriptionProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEmailSubscription_Override ¶
func NewEmailSubscription_Override(e EmailSubscription, emailAddress *string, props *EmailSubscriptionProps)
func NewLambdaSubscription_Override ¶
func NewLambdaSubscription_Override(l LambdaSubscription, fn awslambda.IFunction, props *LambdaSubscriptionProps)
func NewSmsSubscription_Override ¶
func NewSmsSubscription_Override(s SmsSubscription, phoneNumber *string, props *SmsSubscriptionProps)
func NewSqsSubscription_Override ¶
func NewSqsSubscription_Override(s SqsSubscription, queue awssqs.IQueue, props *SqsSubscriptionProps)
func NewUrlSubscription_Override ¶
func NewUrlSubscription_Override(u UrlSubscription, url *string, props *UrlSubscriptionProps)
Types ¶
type EmailSubscription ¶
type EmailSubscription interface { awssns.ITopicSubscription // Returns a configuration for an email address to subscribe to an SNS topic. Bind(_topic awssns.ITopic) *awssns.TopicSubscriptionConfig }
Use an email address as a subscription target.
Email subscriptions require confirmation.
Example:
myTopic := sns.NewTopic(this, jsii.String("Topic")) emailAddress := awscdk.NewCfnParameter(this, jsii.String("email-param")) myTopic.addSubscription(subscriptions.NewEmailSubscription(emailAddress.valueAsString))
func NewEmailSubscription ¶
func NewEmailSubscription(emailAddress *string, props *EmailSubscriptionProps) EmailSubscription
type EmailSubscriptionProps ¶
type EmailSubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // Indicates if the full notification JSON should be sent to the email address or just the message text. Json *bool `field:"optional" json:"json" yaml:"json"` }
Options for email subscriptions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var queue queue var subscriptionFilter subscriptionFilter emailSubscriptionProps := &emailSubscriptionProps{ deadLetterQueue: queue, filterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, json: jsii.Boolean(false), }
type LambdaSubscription ¶
type LambdaSubscription interface { awssns.ITopicSubscription // Returns a configuration for a Lambda function to subscribe to an SNS topic. Bind(topic awssns.ITopic) *awssns.TopicSubscriptionConfig }
Use a Lambda function as a subscription target.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.addSubscription(subscriptions.NewLambdaSubscription(fn, &lambdaSubscriptionProps{ filterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter.stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter.stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter.numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter.existsFilter(), }, }))
func NewLambdaSubscription ¶
func NewLambdaSubscription(fn awslambda.IFunction, props *LambdaSubscriptionProps) LambdaSubscription
type LambdaSubscriptionProps ¶
type LambdaSubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` }
Properties for a Lambda subscription.
Example:
import lambda "github.com/aws/aws-cdk-go/awscdk" var fn function myTopic := sns.NewTopic(this, jsii.String("MyTopic")) // Lambda should receive only message matching the following conditions on attributes: // color: 'red' or 'orange' or begins with 'bl' // size: anything but 'small' or 'medium' // price: between 100 and 200 or greater than 300 // store: attribute must be present myTopic.addSubscription(subscriptions.NewLambdaSubscription(fn, &lambdaSubscriptionProps{ filterPolicy: map[string]subscriptionFilter{ "color": sns.*subscriptionFilter.stringFilter(&StringConditions{ "allowlist": []*string{ jsii.String("red"), jsii.String("orange"), }, "matchPrefixes": []*string{ jsii.String("bl"), }, }), "size": sns.*subscriptionFilter.stringFilter(&StringConditions{ "denylist": []*string{ jsii.String("small"), jsii.String("medium"), }, }), "price": sns.*subscriptionFilter.numericFilter(&NumericConditions{ "between": &BetweenCondition{ "start": jsii.Number(100), "stop": jsii.Number(200), }, "greaterThan": jsii.Number(300), }), "store": sns.*subscriptionFilter.existsFilter(), }, }))
type SmsSubscription ¶
type SmsSubscription interface { awssns.ITopicSubscription // Returns a configuration used to subscribe to an SNS topic. Bind(_topic awssns.ITopic) *awssns.TopicSubscriptionConfig }
Use an sms address as a subscription target.
Example:
myTopic := sns.NewTopic(this, jsii.String("Topic")) myTopic.addSubscription(subscriptions.NewSmsSubscription(jsii.String("+15551231234")))
func NewSmsSubscription ¶
func NewSmsSubscription(phoneNumber *string, props *SmsSubscriptionProps) SmsSubscription
type SmsSubscriptionProps ¶
type SmsSubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` }
Options for SMS subscriptions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var queue queue var subscriptionFilter subscriptionFilter smsSubscriptionProps := &smsSubscriptionProps{ deadLetterQueue: queue, filterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, }
type SqsSubscription ¶
type SqsSubscription interface { awssns.ITopicSubscription // Returns a configuration for an SQS queue to subscribe to an SNS topic. Bind(topic awssns.ITopic) *awssns.TopicSubscriptionConfig }
Use an SQS queue as a subscription target.
Example:
var queue queue myTopic := sns.NewTopic(this, jsii.String("MyTopic")) myTopic.addSubscription(subscriptions.NewSqsSubscription(queue))
func NewSqsSubscription ¶
func NewSqsSubscription(queue awssqs.IQueue, props *SqsSubscriptionProps) SqsSubscription
type SqsSubscriptionProps ¶
type SqsSubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // The message to the queue is the same as it was sent to the topic. // // If false, the message will be wrapped in an SNS envelope. RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` }
Properties for an SQS subscription.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var queue queue var subscriptionFilter subscriptionFilter sqsSubscriptionProps := &sqsSubscriptionProps{ deadLetterQueue: queue, filterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, rawMessageDelivery: jsii.Boolean(false), }
type SubscriptionProps ¶
type SubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` }
Options to subscribing to an SNS topic.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var queue queue var subscriptionFilter subscriptionFilter subscriptionProps := &subscriptionProps{ deadLetterQueue: queue, filterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, }
type UrlSubscription ¶
type UrlSubscription interface { awssns.ITopicSubscription // Returns a configuration for a URL to subscribe to an SNS topic. Bind(_topic awssns.ITopic) *awssns.TopicSubscriptionConfig }
Use a URL as a subscription target.
The message will be POSTed to the given URL.
Example:
myTopic := sns.NewTopic(this, jsii.String("MyTopic")) myTopic.addSubscription(subscriptions.NewUrlSubscription(jsii.String("https://foobar.com/")))
See: https://docs.aws.amazon.com/sns/latest/dg/sns-http-https-endpoint-as-subscriber.html
func NewUrlSubscription ¶
func NewUrlSubscription(url *string, props *UrlSubscriptionProps) UrlSubscription
type UrlSubscriptionProps ¶
type UrlSubscriptionProps struct { // Queue to be used as dead letter queue. // // If not passed no dead letter queue is enabled. DeadLetterQueue awssqs.IQueue `field:"optional" json:"deadLetterQueue" yaml:"deadLetterQueue"` // The filter policy. FilterPolicy *map[string]awssns.SubscriptionFilter `field:"optional" json:"filterPolicy" yaml:"filterPolicy"` // The subscription's protocol. Protocol awssns.SubscriptionProtocol `field:"optional" json:"protocol" yaml:"protocol"` // The message to the queue is the same as it was sent to the topic. // // If false, the message will be wrapped in an SNS envelope. RawMessageDelivery *bool `field:"optional" json:"rawMessageDelivery" yaml:"rawMessageDelivery"` }
Options for URL subscriptions.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var queue queue var subscriptionFilter subscriptionFilter urlSubscriptionProps := &urlSubscriptionProps{ deadLetterQueue: queue, filterPolicy: map[string]*subscriptionFilter{ "filterPolicyKey": subscriptionFilter, }, protocol: awscdk.Aws_sns.subscriptionProtocol_HTTP, rawMessageDelivery: jsii.Boolean(false), }
Source Files ¶
- awssnssubscriptions.go
- awssnssubscriptions_EmailSubscription.go
- awssnssubscriptions_EmailSubscriptionProps.go
- awssnssubscriptions_EmailSubscription__runtime_type_checks.go
- awssnssubscriptions_LambdaSubscription.go
- awssnssubscriptions_LambdaSubscriptionProps.go
- awssnssubscriptions_LambdaSubscription__runtime_type_checks.go
- awssnssubscriptions_SmsSubscription.go
- awssnssubscriptions_SmsSubscriptionProps.go
- awssnssubscriptions_SmsSubscription__runtime_type_checks.go
- awssnssubscriptions_SqsSubscription.go
- awssnssubscriptions_SqsSubscriptionProps.go
- awssnssubscriptions_SqsSubscription__runtime_type_checks.go
- awssnssubscriptions_SubscriptionProps.go
- awssnssubscriptions_UrlSubscription.go
- awssnssubscriptions_UrlSubscriptionProps.go
- awssnssubscriptions_UrlSubscription__runtime_type_checks.go