class TopicBase
Language | Type name |
---|---|
![]() | aws_cdk.aws_sns.TopicBase |
![]() | software.amazon.awscdk.services.sns.TopicBase |
![]() | Amazon.CDK.AWS.SNS.TopicBase |
![]() | @aws-cdk/aws-sns.TopicBase |
Implements
IConstruct
, IResource
, ITopic
Extends
Resource
Implemented by
Topic
Either a new or imported Topic.
Initializer
new TopicBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
Properties
Name | Type | Description |
---|---|---|
auto | boolean | Controls automatic creation of policy objects. |
node | Construct | Construct tree node which offers APIs for interacting with the construct tree. |
stack | Stack | The stack in which this resource is defined. |
topic | string | |
topic | string |
autoCreatePolicy
Type:
boolean
Controls automatic creation of policy objects.
Set by subclasses.
node
Type:
Construct
Construct tree node which offers APIs for interacting with the construct tree.
stack
Type:
Stack
The stack in which this resource is defined.
topicArn
Type:
string
topicName
Type:
string
Methods
Name | Description |
---|---|
add | Subscribe some endpoint to this topic. |
add | Adds a statement to the IAM resource policy associated with this topic. |
grant | Grant topic publishing permissions to the given identity. |
metric(metricName, props?) | Return the given named metric for this Topic. |
metric | The number of messages published to your Amazon SNS topics. |
metric | The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints. |
metric | The number of messages that Amazon SNS failed to deliver. |
metric | The number of messages that were rejected by subscription filter policies. |
metric | The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid. |
metric | The number of messages that were rejected by subscription filter policies because the messages have no attributes. |
metric | Metric for the size of messages published through this topic. |
metric | The charges you have accrued since the start of the current calendar month for sending SMS messages. |
metric | The rate of successful SMS message deliveries. |
to | Returns a string representation of this construct. |
Subscription(subscription)
addpublic addSubscription(subscription: ITopicSubscription): void
Parameters
- subscription
ITopic
Subscription
Subscribe some endpoint to this topic.
ToResourcePolicy(statement)
addpublic addToResourcePolicy(statement: PolicyStatement): void
Parameters
- statement
Policy
Statement
Adds a statement to the IAM resource policy associated with this topic.
If this topic was created in this stack (new Topic
), a topic policy
will be automatically created upon the first call to addToPolicy
. If
the topic is improted (Topic.import
), then this is a no-op.
Publish(grantee)
grantpublic grantPublish(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant topic publishing permissions to the given identity.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for this Topic.
NumberOfMessagesPublished(props?)
metricpublic metricNumberOfMessagesPublished(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages published to your Amazon SNS topics.
Sum over 5 minutes
NumberOfNotificationsDelivered(props?)
metricpublic metricNumberOfNotificationsDelivered(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints.
Sum over 5 minutes
NumberOfNotificationsFailed(props?)
metricpublic metricNumberOfNotificationsFailed(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages that Amazon SNS failed to deliver.
Sum over 5 minutes
NumberOfNotificationsFilteredOut(props?)
metricpublic metricNumberOfNotificationsFilteredOut(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages that were rejected by subscription filter policies.
Sum over 5 minutes
NumberOfNotificationsFilteredOutInvalidAttributes(props?)
metricpublic metricNumberOfNotificationsFilteredOutInvalidAttributes(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid.
Sum over 5 minutes
NumberOfNotificationsFilteredOutNoMessageAttributes(props?)
metricpublic metricNumberOfNotificationsFilteredOutNoMessageAttributes(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The number of messages that were rejected by subscription filter policies because the messages have no attributes.
Sum over 5 minutes
PublishSize(props?)
metricpublic metricPublishSize(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the size of messages published through this topic.
Average over 5 minutes
SMSMonthToDateSpentUSD(props?)
metricpublic metricSMSMonthToDateSpentUSD(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The charges you have accrued since the start of the current calendar month for sending SMS messages.
Maximum over 5 minutes
SMSSuccessRate(props?)
metricpublic metricSMSSuccessRate(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
The rate of successful SMS message deliveries.
Sum over 5 minutes
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.