Skip to content

Amazon SNS Channel Binding v0.1.0

The Amazon SNS channel binding object defines the configuration for an SNS topic, which corresponds to an AsyncAPI channel.

This binding allows you to define an SNS topic’s properties, including its name, ordering (for FIFO topics), access policy, and tags.

Property Type Description
name string Required. The name of the SNS topic.
ordering object Configures the topic as either standard or FIFO. See Ordering Object.
policy object The access policy for the topic. See Topic Policy.
tags object Key-value pairs representing AWS tags for the topic.
bindingVersion string The version of this binding. For v0.1.0, this MUST be 0.1.0.

Specifies the topic type and, for FIFO topics, the deduplication setting.

Property Type Description
type string Required. Can be standard or FIFO.
contentBasedDeduplication boolean For FIFO topics, enables content-based deduplication.

Defines the permissions for the SNS topic using a list of policy statements.

Property Type Description
statements [object] Required. An array of statement objects, each controlling a permission for the topic.

Each statement object contains:

  • effect: Allow or Deny.
  • principal: The AWS account or resource ARN that this statement applies to.
  • action: The SNS permission being controlled (e.g., sns:Publish).

This example defines a standard SNS topic named user-events.

channels:
userEvents:
bindings:
sns:
name: user-events
ordering:
type: standard
bindingVersion: '0.1.0'

This example attaches a policy that allows any principal (*) to publish messages to this topic.

channels:
publicEvents:
bindings:
sns:
name: public-events
policy:
statements:
- effect: Allow
principal: '*'
action: 'sns:Publish'
bindingVersion: '0.1.0'

Version 0.2.0 introduced several enhancements to the policy.statements object:

  • The principal property was updated to support complex object types for AWS and Service principals, in addition to string ARNs.
  • The resource property was added to specify which resources the policy statement applies to.
  • The condition property was added to allow for more granular control over when the policy is in effect.