steampipe plugin install aws

Table: aws_sns_subscription - Query AWS Simple Notification Service (SNS) Topic Subscriptions using SQL

The AWS Simple Notification Service (SNS) Topic Subscriptions allow you to manage and handle messages published to topics. Subscriptions define the endpoints to which messages will be delivered, allowing for the decoupling of microservices, distributed systems, and serverless applications. AWS SNS Topic Subscriptions support a variety of protocols including HTTP, HTTPS, Email, Email-JSON, SQS, Application, Lambda, and SMS.

Table Usage Guide

The aws_sns_subscription table in Steampipe provides you with information about topic subscriptions within AWS Simple Notification Service (SNS). This table allows you, as a DevOps engineer, to query subscription-specific details, including subscription ARN, owner, protocol, endpoint, and more. You can utilize this table to gather insights on subscriptions, such as subscription status, delivery policy, raw message delivery, and more. The schema outlines the various attributes of the SNS topic subscription for you, including the subscription ARN, topic ARN, owner, protocol, and associated tags.

Examples

List of subscriptions which are not configured with dead letter queue

Determine the areas in which AWS SNS Topic subscriptions lack a configured dead letter queue. This is useful for identifying potential points of failure in message delivery, as messages could be lost if the subscription service is unavailable and there is no dead letter queue set up.

select
title,
redrive_policy
from
aws_sns_subscription
where
redrive_policy is null;
select
title,
redrive_policy
from
aws_sns_subscription
where
redrive_policy is null;

List of subscriptions which are not configured to filter messages

Determine the areas in which subscriptions are not set up to filter messages. This is beneficial for identifying potential inefficiencies or areas of improvement within your notification system.

select
title,
filter_policy
from
aws_sns_subscription
where
filter_policy is null;
select
title,
filter_policy
from
aws_sns_subscription
where
filter_policy is null;

List subscription count by topic arn

Determine the areas in which your AWS SNS topics are gaining the most traction by analyzing the number of subscriptions each topic has. This can help prioritize content creation and resource allocation for popular topics.

select
title,
count(subscription_arn) as subscription_count
from
aws_sns_subscription
group by
title;
select
title,
count(subscription_arn) as subscription_count
from
aws_sns_subscription
group by
title;

Schema for aws_sns_subscription

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
confirmation_was_authenticatedbooleanReflects authentication status of the subscription.
delivery_policyjsonbThe JSON of the subscription's delivery policy.
effective_delivery_policyjsonbThe JSON of the effective delivery policy that takes into account the topic delivery policy and account system defaults.
endpointtextThe subscription's endpoint (format depends on the protocol).
filter_policyjsonbThe filter policy JSON that is assigned to the subscription.
ownertextThe AWS account ID of the subscription's owner.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
pending_confirmationbooleanReflects the confirmation status of the subscription. True if the subscription hasn't been confirmed.
protocoltextThe subscription's protocol.
raw_message_deliverybooleantrue if raw message delivery is enabled for the subscription.
redrive_policyjsonbWhen 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.
regiontextThe AWS Region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subscription_arntext=Amazon Resource Name of the subscription.
titletextTitle of the resource.
topic_arntextThe topic ARN that the subscription is associated with.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws

You can pass the configuration to the command with the --config argument:

steampipe_export_aws --config '<your_config>' aws_sns_subscription