2018-03-22 16:55:23 +00:00
---
title: About the aws_sns_topics Resource
---
# aws\_sns\_topics
2019-04-26 18:24:29 +00:00
Use the `aws_sns_topics` Chef InSpec audit resource to test all or a group of the SNS Topic ARNs in an account.
2018-03-22 16:55:23 +00:00
2019-04-26 18:24:29 +00:00
User the 'aws_sns_topic' Chef InSpec audit resource to test a single SNS Topic in an account.
2018-03-22 16:55:23 +00:00
<br>
2018-08-09 12:34:49 +00:00
## Availability
### Installation
2019-04-26 18:24:29 +00:00
This resource is distributed along with Chef InSpec itself. You can use it automatically.
2018-08-09 12:34:49 +00:00
### Version
This resource first became available in v2.1.10 of InSpec.
2018-03-22 16:55:23 +00:00
## Syntax
An `aws_sns_topics` resource block takes no filter conditions.
# Get all SNS Topic arns
describe aws_sns_topics do
its('topic_arns') { should include 'arn:aws:sns:us-east-1:333344445555:MyTopic' }
end
<br>
## Examples
2019-04-26 18:24:29 +00:00
The following examples show how to use this Chef InSpec audit resource.
2018-03-22 16:55:23 +00:00
As this is the initial release of `aws_sns_topics`, its limited functionality precludes examples.
<br>
## Matchers
### exists
The control will pass if the filter returns at least one result. Use should_not if you expect zero matches.
# Test if there is any SNS Topics
describe aws_sns_topics
it { should exist }
end
## Properties
### topic\_arns
Provides an array of all SNS Topic arns.
# Test that a specific SNS Topic exists
describe aws_sns_topics do
its('topic_arns') { should include 'arn:aws:sns:us-east-1:333344445555:MyTopic' }
end
2018-05-10 18:57:53 +00:00
## AWS Permissions
Your [Principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html#intro-structure-principal) will need the `sns:ListTopics` action with Effect set to Allow.
You can find detailed documentation at [Actions, Resources, and Condition Keys for Amazon SNS](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsns.html).