AWS IoT Policy

This page shows how to write Terraform and CloudFormation for AWS IoT Policy and write them securely.

aws_iot_policy (Terraform)

The Policy in AWS IoT can be configured in Terraform with the resource name aws_iot_policy. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

wildcard_principal.tf#L9
resource "aws_iot_policy" "iot_allow_no_wildcard" {
  name = "PubSubToAnyTopic"

  policy = <<EOF
{
  "Version": "2012-10-17",
wildcard_principal.tf#L9
resource "aws_iot_policy" "iot_allow_no_wildcard" {
  name = "PubSubToAnyTopic"

  policy = <<EOF
{
  "Version": "2012-10-17",
policy.tf#L18
resource "aws_iot_policy" "iot" {
  name   = var.project
  policy = <<EOF
{
        "Version": "2012-10-17",
        "Statement": [
iot.tf#L1
resource "aws_iot_policy" "policy" {
  name        = "temperature-system-policy"
  policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an IoT policy.

AWS::IoT::Policy (CloudFormation)

The Policy in IoT can be configured in CloudFormation with the resource name AWS::IoT::Policy. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

Use the AWS::IoT::Policy resource to declare an AWS IoT policy. For more information about working with AWS IoT policies, see Authorization in the AWS IoT Developer Guide.

Frequently asked questions

What is AWS IoT Policy?

AWS IoT Policy is a resource for IoT of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS IoT Policy?

For Terraform, the ffsclyh/config-lint, stelligent/config-lint and luismayta/iot-air-pollution source code examples are useful. See the Terraform Example section for further details.