UrlSubscription Class
Use a URL as a subscription target.
The message will be POSTed to the given URL.
Example
ts
const myTopic = new sns.Topic(this, 'MyTopic');
const url = new CfnParameter(this, 'url-param');
myTopic.addSubscription(new subscriptions.UrlSubscription(url.valueAsString));
python
my_topic = sns.Topic(self, "MyTopic")
url = CfnParameter(self, "url-param")
my_topic.add_subscription(subscriptions.UrlSubscription(url.value_as_string))
java
Topic myTopic = new Topic(this, "MyTopic");
CfnParameter url = new CfnParameter(this, "url-param");
myTopic.addSubscription(new UrlSubscription(url.getValueAsString()));
csharp
// Install: dotnet add package Amazon.CDK.Lib
var myTopic = new Topic(this, "MyTopic");
var url = new CfnParameter(this, "url-param");
myTopic.AddSubscription(new UrlSubscription(url.ValueAsString));
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
myTopic := sns.NewTopic(this, jsii.String("MyTopic"))
url := awscdk.NewCfnParameter(this, jsii.String("url-param"))
myTopic.AddSubscription(subscriptions.NewUrlSubscription(url.valueAsString))
Initializer
ts
new UrlSubscription(url: string, props?: UrlSubscriptionProps)
python
UrlSubscription(url: str, props: typing.Optional[UrlSubscriptionProps] = None)
java
new UrlSubscription(String url, UrlSubscriptionProps props)
csharp
new UrlSubscription(string url, UrlSubscriptionProps? props = null)
go
NewUrlSubscription(Url *string, Props UrlSubscriptionProps)
Properties
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringstatic#Uniquely identifies this class.
Methods
bind(_topic: ITopic): TopicSubscriptionConfigdef bind(self, _topic: ITopic) -> TopicSubscriptionConfigpublic TopicSubscriptionConfig bind(ITopic _topic)public TopicSubscriptionConfig Bind(ITopic _topic)func Bind(_topic ITopic) TopicSubscriptionConfig#Returns a configuration for a URL to subscribe to an SNS topic.