» Resource: aws_iot_policy

Provides an IoT policy.

» Example Usage

resource "aws_iot_policy" "pubsub" {
  name = "PubSubToAnyTopic"

  policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "iot:*"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}
EOF
}

» Argument Reference

The following arguments are supported:

  • name - (Required) The name of the policy.
  • policy - (Required) The policy document. This is a JSON formatted string. Use the IoT Developer Guide for more information on IoT Policies. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide.

» Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The ARN assigned by AWS to this policy.
  • name - The name of this policy.
  • default_version_id - The default version of this policy.
  • policy - The policy document.