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. The heredoc syntax or file function is helpful here. Use the IoT Developer Guide for more information on IoT Policies

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.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/r/iot_policy.html