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
resource "aws_iot_policy" "iot_allow_no_wildcard" {
name = "PubSubToAnyTopic"
policy = <<EOF
{
"Version": "2012-10-17",
resource "aws_iot_policy" "iot_allow_no_wildcard" {
name = "PubSubToAnyTopic"
policy = <<EOF
{
"Version": "2012-10-17",
resource "aws_iot_policy" "iot" {
name = var.project
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
resource "aws_iot_policy" "policy" {
name = "temperature-system-policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
Parameters
-
arn
optional computed - string -
default_version_id
optional computed - string -
id
optional computed - string -
name
required - string -
policy
required - string
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
-
PolicyDocument
required - Json -
PolicyName
optional - String
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.