awssns

package
v2.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CfnSubscription_CFN_RESOURCE_TYPE_NAME

func CfnSubscription_CFN_RESOURCE_TYPE_NAME() *string

func CfnSubscription_IsCfnElement

func CfnSubscription_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnSubscription_IsCfnResource

func CfnSubscription_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnSubscription_IsConstruct

func CfnSubscription_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func CfnTopicPolicy_CFN_RESOURCE_TYPE_NAME

func CfnTopicPolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnTopicPolicy_IsCfnElement

func CfnTopicPolicy_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnTopicPolicy_IsCfnResource

func CfnTopicPolicy_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnTopicPolicy_IsConstruct

func CfnTopicPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func CfnTopic_CFN_RESOURCE_TYPE_NAME

func CfnTopic_CFN_RESOURCE_TYPE_NAME() *string

func CfnTopic_IsCfnElement

func CfnTopic_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnTopic_IsCfnResource

func CfnTopic_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource.

func CfnTopic_IsConstruct

func CfnTopic_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func NewCfnSubscription_Override

func NewCfnSubscription_Override(c CfnSubscription, scope constructs.Construct, id *string, props *CfnSubscriptionProps)

Create a new `AWS::SNS::Subscription`.

func NewCfnTopicPolicy_Override

func NewCfnTopicPolicy_Override(c CfnTopicPolicy, scope constructs.Construct, id *string, props *CfnTopicPolicyProps)

Create a new `AWS::SNS::TopicPolicy`.

func NewCfnTopic_Override

func NewCfnTopic_Override(c CfnTopic, scope constructs.Construct, id *string, props *CfnTopicProps)

Create a new `AWS::SNS::Topic`.

func NewSubscriptionFilter_Override

func NewSubscriptionFilter_Override(s SubscriptionFilter, conditions *[]interface{})

func NewSubscription_Override

func NewSubscription_Override(s Subscription, scope constructs.Construct, id *string, props *SubscriptionProps)

func NewTopicBase_Override

func NewTopicBase_Override(t TopicBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

func NewTopicPolicy_Override

func NewTopicPolicy_Override(t TopicPolicy, scope constructs.Construct, id *string, props *TopicPolicyProps)

func NewTopic_Override

func NewTopic_Override(t Topic, scope constructs.Construct, id *string, props *TopicProps)

func Subscription_IsConstruct

func Subscription_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func Subscription_IsResource

func Subscription_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func TopicBase_IsConstruct

func TopicBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func TopicBase_IsResource

func TopicBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func TopicPolicy_IsConstruct

func TopicPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func TopicPolicy_IsResource

func TopicPolicy_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Topic_IsConstruct

func Topic_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func Topic_IsResource

func Topic_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

Types

type BetweenCondition

type BetweenCondition struct {
	// The start value.
	Start *float64 `json:"start" yaml:"start"`
	// The stop value.
	Stop *float64 `json:"stop" yaml:"stop"`
}

Between condition for a numeric attribute.

TODO: EXAMPLE

type CfnSubscription

type CfnSubscription interface {
	awscdk.CfnResource
	awscdk.IInspectable
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	CfnResourceType() *string
	CreationStack() *[]*string
	DeliveryPolicy() interface{}
	SetDeliveryPolicy(val interface{})
	Endpoint() *string
	SetEndpoint(val *string)
	FilterPolicy() interface{}
	SetFilterPolicy(val interface{})
	LogicalId() *string
	Node() constructs.Node
	Protocol() *string
	SetProtocol(val *string)
	RawMessageDelivery() interface{}
	SetRawMessageDelivery(val interface{})
	RedrivePolicy() interface{}
	SetRedrivePolicy(val interface{})
	Ref() *string
	Region() *string
	SetRegion(val *string)
	Stack() awscdk.Stack
	SubscriptionRoleArn() *string
	SetSubscriptionRoleArn(val *string)
	TopicArn() *string
	SetTopicArn(val *string)
	UpdatedProperites() *map[string]interface{}
	AddDeletionOverride(path *string)
	AddDependsOn(target awscdk.CfnResource)
	AddMetadata(key *string, value interface{})
	AddOverride(path *string, value interface{})
	AddPropertyDeletionOverride(propertyPath *string)
	AddPropertyOverride(propertyPath *string, value interface{})
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	GetAtt(attributeName *string) awscdk.Reference
	GetMetadata(key *string) interface{}
	Inspect(inspector awscdk.TreeInspector)
	OverrideLogicalId(newLogicalId *string)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	ShouldSynthesize() *bool
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::SNS::Subscription`.

The `AWS::SNS::Subscription` resource subscribes an endpoint to an Amazon SNS topic. For a subscription to be created, the owner of the endpoint must confirm the subscription.

TODO: EXAMPLE

func NewCfnSubscription

func NewCfnSubscription(scope constructs.Construct, id *string, props *CfnSubscriptionProps) CfnSubscription

Create a new `AWS::SNS::Subscription`.

type CfnSubscriptionProps

type CfnSubscriptionProps struct {
	// The subscription's protocol.
	//
	// For more information, see the `Protocol` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* .
	Protocol *string `json:"protocol" yaml:"protocol"`
	// The ARN of the topic to subscribe to.
	TopicArn *string `json:"topicArn" yaml:"topicArn"`
	// The delivery policy JSON assigned to the subscription.
	//
	// Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message delivery retries](https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html) in the *Amazon SNS Developer Guide* .
	DeliveryPolicy interface{} `json:"deliveryPolicy" yaml:"deliveryPolicy"`
	// The subscription's endpoint.
	//
	// The endpoint value depends on the protocol that you specify. For more information, see the `Endpoint` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* .
	Endpoint *string `json:"endpoint" yaml:"endpoint"`
	// The filter policy JSON assigned to the subscription.
	//
	// Enables the subscriber to filter out unwanted messages. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* and [Message filtering](https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) in the *Amazon SNS Developer Guide* .
	FilterPolicy interface{} `json:"filterPolicy" yaml:"filterPolicy"`
	// When set to `true` , enables raw message delivery.
	//
	// Raw messages don't contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see `[GetSubscriptionAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetSubscriptionAttributes.html)` in the *Amazon SNS API Reference* .
	RawMessageDelivery interface{} `json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
	//
	// Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.
	//
	// For more information about the redrive policy and dead-letter queues, see [Amazon SQS dead-letter queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) in the *Amazon SQS Developer Guide* .
	RedrivePolicy interface{} `json:"redrivePolicy" yaml:"redrivePolicy"`
	// For cross-region subscriptions, the region in which the topic resides.
	//
	// If no region is specified, AWS CloudFormation uses the region of the caller as the default.
	//
	// If you perform an update operation that only updates the `Region` property of a `AWS::SNS::Subscription` resource, that operation will fail unless you are either:
	//
	// - Updating the `Region` from `NULL` to the caller region.
	// - Updating the `Region` from the caller region to `NULL` .
	Region *string `json:"region" yaml:"region"`
	// This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.
	//
	// Specify the ARN of the IAM role that has the following:
	//
	// - Permission to write to the Amazon Kinesis Data Firehose delivery stream
	// - Amazon SNS listed as a trusted entity
	//
	// Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see [Fanout to Amazon Kinesis Data Firehose delivery streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) in the *Amazon SNS Developer Guide.*
	SubscriptionRoleArn *string `json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"`
}

Properties for defining a `CfnSubscription`.

TODO: EXAMPLE

type CfnTopic

type CfnTopic interface {
	awscdk.CfnResource
	awscdk.IInspectable
	AttrTopicName() *string
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	CfnResourceType() *string
	ContentBasedDeduplication() interface{}
	SetContentBasedDeduplication(val interface{})
	CreationStack() *[]*string
	DisplayName() *string
	SetDisplayName(val *string)
	FifoTopic() interface{}
	SetFifoTopic(val interface{})
	KmsMasterKeyId() *string
	SetKmsMasterKeyId(val *string)
	LogicalId() *string
	Node() constructs.Node
	Ref() *string
	Stack() awscdk.Stack
	Subscription() interface{}
	SetSubscription(val interface{})
	Tags() awscdk.TagManager
	TopicName() *string
	SetTopicName(val *string)
	UpdatedProperites() *map[string]interface{}
	AddDeletionOverride(path *string)
	AddDependsOn(target awscdk.CfnResource)
	AddMetadata(key *string, value interface{})
	AddOverride(path *string, value interface{})
	AddPropertyDeletionOverride(propertyPath *string)
	AddPropertyOverride(propertyPath *string, value interface{})
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	GetAtt(attributeName *string) awscdk.Reference
	GetMetadata(key *string) interface{}
	Inspect(inspector awscdk.TreeInspector)
	OverrideLogicalId(newLogicalId *string)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	ShouldSynthesize() *bool
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::SNS::Topic`.

The `AWS::SNS::Topic` resource creates a topic to which notifications can be published.

> One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see [Amazon SNS endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in the *AWS General Reference* .

TODO: EXAMPLE

func NewCfnTopic

func NewCfnTopic(scope constructs.Construct, id *string, props *CfnTopicProps) CfnTopic

Create a new `AWS::SNS::Topic`.

type CfnTopicPolicy

type CfnTopicPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	CfnResourceType() *string
	CreationStack() *[]*string
	LogicalId() *string
	Node() constructs.Node
	PolicyDocument() interface{}
	SetPolicyDocument(val interface{})
	Ref() *string
	Stack() awscdk.Stack
	Topics() *[]*string
	SetTopics(val *[]*string)
	UpdatedProperites() *map[string]interface{}
	AddDeletionOverride(path *string)
	AddDependsOn(target awscdk.CfnResource)
	AddMetadata(key *string, value interface{})
	AddOverride(path *string, value interface{})
	AddPropertyDeletionOverride(propertyPath *string)
	AddPropertyOverride(propertyPath *string, value interface{})
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	GetAtt(attributeName *string) awscdk.Reference
	GetMetadata(key *string) interface{}
	Inspect(inspector awscdk.TreeInspector)
	OverrideLogicalId(newLogicalId *string)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	ShouldSynthesize() *bool
	ToString() *string
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::SNS::TopicPolicy`.

The `AWS::SNS::TopicPolicy` resource associates Amazon SNS topics with a policy. For an example snippet, see [Declaring an Amazon SNS policy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-sns-policy) in the *AWS CloudFormation User Guide* .

TODO: EXAMPLE

func NewCfnTopicPolicy

func NewCfnTopicPolicy(scope constructs.Construct, id *string, props *CfnTopicPolicyProps) CfnTopicPolicy

Create a new `AWS::SNS::TopicPolicy`.

type CfnTopicPolicyProps

type CfnTopicPolicyProps struct {
	// A policy document that contains permissions to add to the specified SNS topics.
	PolicyDocument interface{} `json:"policyDocument" yaml:"policyDocument"`
	// The Amazon Resource Names (ARN) of the topics to which you want to add the policy.
	//
	// You can use the `[Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html)` function to specify an `[AWS::SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-topic.html)` resource.
	Topics *[]*string `json:"topics" yaml:"topics"`
}

Properties for defining a `CfnTopicPolicy`.

TODO: EXAMPLE

type CfnTopicProps

type CfnTopicProps struct {
	// Enables content-based deduplication for FIFO topics.
	//
	// - By default, `ContentBasedDeduplication` is set to `false` . If you create a FIFO topic and this attribute is `false` , you must specify a value for the `MessageDeduplicationId` parameter for the [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action.
	// - When you set `ContentBasedDeduplication` to `true` , Amazon SNS uses a SHA-256 hash to generate the `MessageDeduplicationId` using the body of the message (but not the attributes of the message).
	//
	// (Optional) To override the generated value, you can specify a value for the the `MessageDeduplicationId` parameter for the `Publish` action.
	ContentBasedDeduplication interface{} `json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"`
	// The display name to use for an Amazon SNS topic with SMS subscriptions.
	DisplayName *string `json:"displayName" yaml:"displayName"`
	// Set to true to create a FIFO topic.
	FifoTopic interface{} `json:"fifoTopic" yaml:"fifoTopic"`
	// The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
	//
	// For more information, see [Key terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms) . For more examples, see `[KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters)` in the *AWS Key Management Service API Reference* .
	//
	// This property applies only to [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html) .
	KmsMasterKeyId *string `json:"kmsMasterKeyId" yaml:"kmsMasterKeyId"`
	// The Amazon SNS subscriptions (endpoints) for this topic.
	Subscription interface{} `json:"subscription" yaml:"subscription"`
	// The list of tags to add to a new topic.
	//
	// > To be able to tag a topic on creation, you must have the `sns:CreateTopic` and `sns:TagResource` permissions.
	Tags *[]*awscdk.CfnTag `json:"tags" yaml:"tags"`
	// The name of the topic you want to create.
	//
	// Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with `.fifo` .
	//
	// If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see [Name type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
	//
	// > If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
	TopicName *string `json:"topicName" yaml:"topicName"`
}

Properties for defining a `CfnTopic`.

TODO: EXAMPLE

type CfnTopic_SubscriptionProperty

type CfnTopic_SubscriptionProperty struct {
	// The endpoint that receives notifications from the Amazon SNS topic.
	//
	// The endpoint value depends on the protocol that you specify. For more information, see the `Endpoint` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* .
	Endpoint *string `json:"endpoint" yaml:"endpoint"`
	// The subscription's protocol.
	//
	// For more information, see the `Protocol` parameter of the `[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)` action in the *Amazon SNS API Reference* .
	Protocol *string `json:"protocol" yaml:"protocol"`
}

`Subscription` is an embedded property that describes the subscription endpoints of an Amazon SNS topic.

> For full control over subscription behavior (for example, delivery policy, filtering, raw message delivery, and cross-region subscriptions), use the [AWS::SNS::Subscription](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html) resource.

TODO: EXAMPLE

type ITopic

type ITopic interface {
	awscodestarnotifications.INotificationRuleTarget
	awscdk.IResource
	// Subscribe some endpoint to this topic.
	AddSubscription(subscription ITopicSubscription)
	// 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 imported (`Topic.import`), then this is a no-op.
	AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult
	// Grant topic publishing permissions to the given identity.
	GrantPublish(identity awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this Topic.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages published to your Amazon SNS topics.
	//
	// Sum over 5 minutes
	MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints.
	//
	// Sum over 5 minutes
	MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages that Amazon SNS failed to deliver.
	//
	// Sum over 5 minutes
	MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages that were rejected by subscription filter policies.
	//
	// Sum over 5 minutes
	MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid.
	//
	// Sum over 5 minutes
	MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The number of messages that were rejected by subscription filter policies because the messages have no attributes.
	//
	// Sum over 5 minutes
	MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the size of messages published through this topic.
	//
	// Average over 5 minutes
	MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The charges you have accrued since the start of the current calendar month for sending SMS messages.
	//
	// Maximum over 5 minutes
	MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The rate of successful SMS message deliveries.
	//
	// Sum over 5 minutes
	MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Whether this topic is an Amazon SNS FIFO queue.
	//
	// If false, this is a standard topic.
	Fifo() *bool
	// The ARN of the topic.
	TopicArn() *string
	// The name of the topic.
	TopicName() *string
}

Represents an SNS topic.

func Topic_FromTopicArn

func Topic_FromTopicArn(scope constructs.Construct, id *string, topicArn *string) ITopic

Import an existing SNS topic provided an ARN.

type ITopicSubscription

type ITopicSubscription interface {
	// Returns a configuration used to subscribe to an SNS topic.
	Bind(topic ITopic) *TopicSubscriptionConfig
}

Topic subscription.

type NumericConditions

type NumericConditions struct {
	// Match one or more values.
	Allowlist *[]*float64 `json:"allowlist" yaml:"allowlist"`
	// Match values that are between the specified values.
	Between *BetweenCondition `json:"between" yaml:"between"`
	// Match values that are strictly between the specified values.
	BetweenStrict *BetweenCondition `json:"betweenStrict" yaml:"betweenStrict"`
	// Match values that are greater than the specified value.
	GreaterThan *float64 `json:"greaterThan" yaml:"greaterThan"`
	// Match values that are greater than or equal to the specified value.
	GreaterThanOrEqualTo *float64 `json:"greaterThanOrEqualTo" yaml:"greaterThanOrEqualTo"`
	// Match values that are less than the specified value.
	LessThan *float64 `json:"lessThan" yaml:"lessThan"`
	// Match values that are less than or equal to the specified value.
	LessThanOrEqualTo *float64 `json:"lessThanOrEqualTo" yaml:"lessThanOrEqualTo"`
}

Conditions that can be applied to numeric attributes.

TODO: EXAMPLE

type StringConditions

type StringConditions struct {
	// Match one or more values.
	Allowlist *[]*string `json:"allowlist" yaml:"allowlist"`
	// Match any value that doesn't include any of the specified values.
	Denylist *[]*string `json:"denylist" yaml:"denylist"`
	// Matches values that begins with the specified prefixes.
	MatchPrefixes *[]*string `json:"matchPrefixes" yaml:"matchPrefixes"`
}

Conditions that can be applied to string attributes.

TODO: EXAMPLE

type Subscription

type Subscription interface {
	awscdk.Resource
	DeadLetterQueue() awssqs.IQueue
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

A new subscription.

Prefer to use the `ITopic.addSubscription()` methods to create instances of this class.

TODO: EXAMPLE

func NewSubscription

func NewSubscription(scope constructs.Construct, id *string, props *SubscriptionProps) Subscription

type SubscriptionFilter

type SubscriptionFilter interface {
	Conditions() *[]interface{}
}

A subscription filter for an attribute.

TODO: EXAMPLE

func NewSubscriptionFilter

func NewSubscriptionFilter(conditions *[]interface{}) SubscriptionFilter

func SubscriptionFilter_ExistsFilter

func SubscriptionFilter_ExistsFilter() SubscriptionFilter

Returns a subscription filter for attribute key matching.

func SubscriptionFilter_NumericFilter

func SubscriptionFilter_NumericFilter(numericConditions *NumericConditions) SubscriptionFilter

Returns a subscription filter for a numeric attribute.

func SubscriptionFilter_StringFilter

func SubscriptionFilter_StringFilter(stringConditions *StringConditions) SubscriptionFilter

Returns a subscription filter for a string attribute.

type SubscriptionOptions

type SubscriptionOptions struct {
	// The subscription endpoint.
	//
	// The meaning of this value depends on the value for 'protocol'.
	Endpoint *string `json:"endpoint" yaml:"endpoint"`
	// What type of subscription to add.
	Protocol SubscriptionProtocol `json:"protocol" yaml:"protocol"`
	// Queue to be used as dead letter queue.
	//
	// If not passed no dead letter queue is enabled.
	DeadLetterQueue awssqs.IQueue `json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	FilterPolicy *map[string]SubscriptionFilter `json:"filterPolicy" yaml:"filterPolicy"`
	// true if raw message delivery is enabled for the subscription.
	//
	// Raw messages are free of JSON formatting and can be
	// sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple
	// Notification Service API Reference.
	RawMessageDelivery *bool `json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	Region *string `json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	SubscriptionRoleArn *string `json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"`
}

Options for creating a new subscription.

TODO: EXAMPLE

type SubscriptionProps

type SubscriptionProps struct {
	// The subscription endpoint.
	//
	// The meaning of this value depends on the value for 'protocol'.
	Endpoint *string `json:"endpoint" yaml:"endpoint"`
	// What type of subscription to add.
	Protocol SubscriptionProtocol `json:"protocol" yaml:"protocol"`
	// Queue to be used as dead letter queue.
	//
	// If not passed no dead letter queue is enabled.
	DeadLetterQueue awssqs.IQueue `json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	FilterPolicy *map[string]SubscriptionFilter `json:"filterPolicy" yaml:"filterPolicy"`
	// true if raw message delivery is enabled for the subscription.
	//
	// Raw messages are free of JSON formatting and can be
	// sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple
	// Notification Service API Reference.
	RawMessageDelivery *bool `json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	Region *string `json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	SubscriptionRoleArn *string `json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"`
	// The topic to subscribe to.
	Topic ITopic `json:"topic" yaml:"topic"`
}

Properties for creating a new subscription.

TODO: EXAMPLE

type SubscriptionProtocol

type SubscriptionProtocol string

The type of subscription, controlling the type of the endpoint parameter.

TODO: EXAMPLE

const (
	SubscriptionProtocol_HTTP        SubscriptionProtocol = "HTTP"
	SubscriptionProtocol_HTTPS       SubscriptionProtocol = "HTTPS"
	SubscriptionProtocol_EMAIL       SubscriptionProtocol = "EMAIL"
	SubscriptionProtocol_EMAIL_JSON  SubscriptionProtocol = "EMAIL_JSON"
	SubscriptionProtocol_SMS         SubscriptionProtocol = "SMS"
	SubscriptionProtocol_SQS         SubscriptionProtocol = "SQS"
	SubscriptionProtocol_APPLICATION SubscriptionProtocol = "APPLICATION"
	SubscriptionProtocol_LAMBDA      SubscriptionProtocol = "LAMBDA"
	SubscriptionProtocol_FIREHOSE    SubscriptionProtocol = "FIREHOSE"
)

type Topic

type Topic interface {
	TopicBase
	AutoCreatePolicy() *bool
	Env() *awscdk.ResourceEnvironment
	Fifo() *bool
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	TopicArn() *string
	TopicName() *string
	AddSubscription(subscription ITopicSubscription)
	AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	BindAsNotificationRuleTarget(_scope constructs.Construct) *awscodestarnotifications.NotificationRuleTargetConfig
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	GrantPublish(grantee awsiam.IGrantable) awsiam.Grant
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

A new SNS topic.

TODO: EXAMPLE

func NewTopic

func NewTopic(scope constructs.Construct, id *string, props *TopicProps) Topic

type TopicBase

type TopicBase interface {
	awscdk.Resource
	ITopic
	AutoCreatePolicy() *bool
	Env() *awscdk.ResourceEnvironment
	Fifo() *bool
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	TopicArn() *string
	TopicName() *string
	AddSubscription(subscription ITopicSubscription)
	AddToResourcePolicy(statement awsiam.PolicyStatement) *awsiam.AddToResourcePolicyResult
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	BindAsNotificationRuleTarget(_scope constructs.Construct) *awscodestarnotifications.NotificationRuleTargetConfig
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	GrantPublish(grantee awsiam.IGrantable) awsiam.Grant
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfMessagesPublished(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsDelivered(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFailed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOut(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOutInvalidAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricNumberOfNotificationsFilteredOutNoMessageAttributes(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricPublishSize(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricSMSMonthToDateSpentUSD(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricSMSSuccessRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

Either a new or imported Topic.

type TopicPolicy

type TopicPolicy interface {
	awscdk.Resource
	Document() awsiam.PolicyDocument
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

The policy for an SNS Topic.

Policies define the operations that are allowed on this resource.

You almost never need to define this construct directly.

All AWS resources that support resource policies have a method called `addToResourcePolicy()`, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy.

Prefer to use `addToResourcePolicy()` instead.

TODO: EXAMPLE

func NewTopicPolicy

func NewTopicPolicy(scope constructs.Construct, id *string, props *TopicPolicyProps) TopicPolicy

type TopicPolicyProps

type TopicPolicyProps struct {
	// The set of topics this policy applies to.
	Topics *[]ITopic `json:"topics" yaml:"topics"`
	// IAM policy document to apply to topic(s).
	PolicyDocument awsiam.PolicyDocument `json:"policyDocument" yaml:"policyDocument"`
}

Properties to associate SNS topics with a policy.

TODO: EXAMPLE

type TopicProps

type TopicProps struct {
	// Enables content-based deduplication for FIFO topics.
	ContentBasedDeduplication *bool `json:"contentBasedDeduplication" yaml:"contentBasedDeduplication"`
	// A developer-defined string that can be used to identify this SNS topic.
	DisplayName *string `json:"displayName" yaml:"displayName"`
	// Set to true to create a FIFO topic.
	Fifo *bool `json:"fifo" yaml:"fifo"`
	// A KMS Key, either managed by this CDK app, or imported.
	MasterKey awskms.IKey `json:"masterKey" yaml:"masterKey"`
	// A name for the topic.
	//
	// If you don't specify a name, AWS CloudFormation generates a unique
	// physical ID and uses that ID for the topic name. For more information,
	// see Name Type.
	TopicName *string `json:"topicName" yaml:"topicName"`
}

Properties for a new SNS topic.

TODO: EXAMPLE

type TopicSubscriptionConfig

type TopicSubscriptionConfig struct {
	// The subscription endpoint.
	//
	// The meaning of this value depends on the value for 'protocol'.
	Endpoint *string `json:"endpoint" yaml:"endpoint"`
	// What type of subscription to add.
	Protocol SubscriptionProtocol `json:"protocol" yaml:"protocol"`
	// Queue to be used as dead letter queue.
	//
	// If not passed no dead letter queue is enabled.
	DeadLetterQueue awssqs.IQueue `json:"deadLetterQueue" yaml:"deadLetterQueue"`
	// The filter policy.
	FilterPolicy *map[string]SubscriptionFilter `json:"filterPolicy" yaml:"filterPolicy"`
	// true if raw message delivery is enabled for the subscription.
	//
	// Raw messages are free of JSON formatting and can be
	// sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple
	// Notification Service API Reference.
	RawMessageDelivery *bool `json:"rawMessageDelivery" yaml:"rawMessageDelivery"`
	// The region where the topic resides, in the case of cross-region subscriptions.
	Region *string `json:"region" yaml:"region"`
	// Arn of role allowing access to firehose delivery stream.
	//
	// Required for a firehose subscription protocol.
	SubscriptionRoleArn *string `json:"subscriptionRoleArn" yaml:"subscriptionRoleArn"`
	// The id of the SNS subscription resource created under `scope`.
	//
	// In most
	// cases, it is recommended to use the `uniqueId` of the topic you are
	// subscribing to.
	SubscriberId *string `json:"subscriberId" yaml:"subscriberId"`
	// The scope in which to create the SNS subscription resource.
	//
	// Normally you'd
	// want the subscription to be created on the consuming stack because the
	// topic is usually referenced by the consumer's resource policy (e.g. SQS
	// queue policy). Otherwise, it will cause a cyclic reference.
	//
	// If this is undefined, the subscription will be created on the topic's stack.
	SubscriberScope constructs.Construct `json:"subscriberScope" yaml:"subscriberScope"`
}

Subscription configuration.

TODO: EXAMPLE

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL