Interface ITopic
Represents an SNS topic.
Inherited Members
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ITopic : IResource, INotificationRuleTarget, ITopicRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Interface ITopic Inherits IResource, INotificationRuleTarget, ITopicRef, IConstruct, IDependable, IEnvironmentAware
Synopsis
Properties
| ContentBasedDeduplication | Enables content-based deduplication for FIFO topics. |
| Fifo | Whether this topic is an Amazon SNS FIFO queue. |
| MasterKey | A KMS Key, either managed by this CDK app, or imported. |
| TopicArn | The ARN of the topic. |
| TopicName | The name of the topic. |
Methods
| AddSubscription(ITopicSubscription) | Subscribe some endpoint to this topic. |
| AddToResourcePolicy(PolicyStatement) | Adds a statement to the IAM resource policy associated with this topic. |
| GrantPublish(IGrantable) | Grant topic publishing permissions to the given identity. |
| GrantSubscribe(IGrantable) | Grant topic subscribing permissions to the given identity. |
| Metric(string, IMetricOptions?) | Return the given named metric for this Topic. |
| MetricNumberOfMessagesPublished(IMetricOptions?) | The number of messages published to your Amazon SNS topics. |
| MetricNumberOfNotificationsDelivered(IMetricOptions?) | The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. |
| MetricNumberOfNotificationsFailed(IMetricOptions?) | The number of messages that Amazon SNS failed to deliver. |
| MetricNumberOfNotificationsFilteredOut(IMetricOptions?) | The number of messages that were rejected by subscription filter policies. |
| MetricNumberOfNotificationsFilteredOutInvalidAttributes(IMetricOptions?) | The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid. |
| MetricNumberOfNotificationsFilteredOutNoMessageAttributes(IMetricOptions?) | The number of messages that were rejected by subscription filter policies because the messages have no attributes. |
| MetricPublishSize(IMetricOptions?) | Metric for the size of messages published through this topic. |
| MetricSMSMonthToDateSpentUSD(IMetricOptions?) | The charges you have accrued since the start of the current calendar month for sending SMS messages. |
| MetricSMSSuccessRate(IMetricOptions?) | The rate of successful SMS message deliveries. |
Properties
ContentBasedDeduplication
Enables content-based deduplication for FIFO topics.
bool ContentBasedDeduplication { get; }
Property Value
Remarks
Attribute: true
Fifo
Whether this topic is an Amazon SNS FIFO queue.
bool Fifo { get; }
Property Value
Remarks
If false, this is a standard topic.
Attribute: true
MasterKey
A KMS Key, either managed by this CDK app, or imported.
IKey? MasterKey { get; }
Property Value
Remarks
This property applies only to server-side encryption.
Default: None
See: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
TopicArn
TopicName
Methods
AddSubscription(ITopicSubscription)
Subscribe some endpoint to this topic.
Subscription AddSubscription(ITopicSubscription subscription)
Parameters
- subscription ITopicSubscription
Returns
AddToResourcePolicy(PolicyStatement)
Adds a statement to the IAM resource policy associated with this topic.
IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
Remarks
If this topic was created in this stack (new Topic), a topic policy
will be automatically created upon the first call to addToResourcePolicy. If
the topic is imported (Topic.import), then this is a no-op.
GrantPublish(IGrantable)
Grant topic publishing permissions to the given identity.
Grant GrantPublish(IGrantable identity)
Parameters
- identity IGrantable
Returns
GrantSubscribe(IGrantable)
Grant topic subscribing permissions to the given identity.
Grant GrantSubscribe(IGrantable identity)
Parameters
- identity IGrantable
Returns
Metric(string, IMetricOptions?)
Return the given named metric for this Topic.
Metric Metric(string metricName, IMetricOptions? props = null)
Parameters
- metricName string
- props IMetricOptions
Returns
MetricNumberOfMessagesPublished(IMetricOptions?)
The number of messages published to your Amazon SNS topics.
Metric MetricNumberOfMessagesPublished(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricNumberOfNotificationsDelivered(IMetricOptions?)
The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints.
Metric MetricNumberOfNotificationsDelivered(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricNumberOfNotificationsFailed(IMetricOptions?)
The number of messages that Amazon SNS failed to deliver.
Metric MetricNumberOfNotificationsFailed(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricNumberOfNotificationsFilteredOut(IMetricOptions?)
The number of messages that were rejected by subscription filter policies.
Metric MetricNumberOfNotificationsFilteredOut(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricNumberOfNotificationsFilteredOutInvalidAttributes(IMetricOptions?)
The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid.
Metric MetricNumberOfNotificationsFilteredOutInvalidAttributes(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricNumberOfNotificationsFilteredOutNoMessageAttributes(IMetricOptions?)
The number of messages that were rejected by subscription filter policies because the messages have no attributes.
Metric MetricNumberOfNotificationsFilteredOutNoMessageAttributes(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes
MetricPublishSize(IMetricOptions?)
Metric for the size of messages published through this topic.
Metric MetricPublishSize(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricSMSMonthToDateSpentUSD(IMetricOptions?)
The charges you have accrued since the start of the current calendar month for sending SMS messages.
Metric MetricSMSMonthToDateSpentUSD(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Maximum over 5 minutes
MetricSMSSuccessRate(IMetricOptions?)
The rate of successful SMS message deliveries.
Metric MetricSMSSuccessRate(IMetricOptions? props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Sum over 5 minutes