From a727061dc25d06aed522abfc52514d12bf848986 Mon Sep 17 00:00:00 2001 From: johnrhen <90864038+johnrhen@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:31:41 -0800 Subject: [PATCH] Create example IoT Thing policy (#731) * Create example claim policy and update formatting on previous examples * Add trailing linebreak --- .../example_claim_policy.json | 62 +++++----- .../example_fleet_provisioning_template.json | 108 +++++++++--------- .../example_iot_thing_policy.json | 10 ++ 3 files changed, 95 insertions(+), 85 deletions(-) create mode 100644 FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_iot_thing_policy.json diff --git a/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_claim_policy.json b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_claim_policy.json index 637ec0362..b76a73b2b 100644 --- a/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_claim_policy.json +++ b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_claim_policy.json @@ -1,31 +1,31 @@ - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "iot:Connect" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "iot:Publish", - "iot:Receive" - ], - "Resource": [ - "arn:aws:iot:::topic/$aws/certificates/create-from-csr/*", - "arn:aws:iot:::topic/$aws/provisioning-templates//provision/*" - ] - }, - { - "Effect": "Allow", - "Action": "iot:Subscribe", - "Resource": [ - "arn:aws:iot:::topicfilter/$aws/certificates/create-from-csr/*", - "arn:aws:iot:::topicfilter/$aws/provisioning-templates//provision/*" - ] - } - ] - } +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "iot:Connect" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "iot:Publish", + "iot:Receive" + ], + "Resource": [ + "arn:aws:iot:::topic/$aws/certificates/create-from-csr/*", + "arn:aws:iot:::topic/$aws/provisioning-templates//provision/*" + ] + }, + { + "Effect": "Allow", + "Action": "iot:Subscribe", + "Resource": [ + "arn:aws:iot:::topicfilter/$aws/certificates/create-from-csr/*", + "arn:aws:iot:::topicfilter/$aws/provisioning-templates//provision/*" + ] + } + ] +} diff --git a/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_fleet_provisioning_template.json b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_fleet_provisioning_template.json index 78d7fca2a..8418142a4 100644 --- a/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_fleet_provisioning_template.json +++ b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_fleet_provisioning_template.json @@ -1,54 +1,54 @@ - { - "Parameters": { - "SerialNumber": { - "Type": "String" - }, - "AWS::IoT::Certificate::Id": { - "Type": "String" - } - }, - "Resources": { - "certificate": { - "Properties": { - "CertificateId": { - "Ref": "AWS::IoT::Certificate::Id" - }, - "Status": "Active" - }, - "Type": "AWS::IoT::Certificate" - }, - "policy": { - "Properties": { - "PolicyName": "" - }, - "Type": "AWS::IoT::Policy" - }, - "thing": { - "OverrideSettings": { - "AttributePayload": "MERGE", - "ThingGroups": "DO_NOTHING", - "ThingTypeName": "REPLACE" - }, - "Properties": { - "AttributePayload": {}, - "ThingGroups": [], - "ThingName": { - "Fn::Join": [ - "", - [ - "fp_demo_", - { - "Ref": "SerialNumber" - } - ] - ] - }, - "ThingTypeName": "fp_demo_things" - }, - "Type": "AWS::IoT::Thing" - } - }, - "DeviceConfiguration": { - "Foo": "Bar" - } - } +{ + "Parameters": { + "SerialNumber": { + "Type": "String" + }, + "AWS::IoT::Certificate::Id": { + "Type": "String" + } + }, + "Resources": { + "certificate": { + "Properties": { + "CertificateId": { + "Ref": "AWS::IoT::Certificate::Id" + }, + "Status": "Active" + }, + "Type": "AWS::IoT::Certificate" + }, + "policy": { + "Properties": { + "PolicyName": "" + }, + "Type": "AWS::IoT::Policy" + }, + "thing": { + "OverrideSettings": { + "AttributePayload": "MERGE", + "ThingGroups": "DO_NOTHING", + "ThingTypeName": "REPLACE" + }, + "Properties": { + "AttributePayload": {}, + "ThingGroups": [], + "ThingName": { + "Fn::Join": [ + "", + [ + "fp_demo_", + { + "Ref": "SerialNumber" + } + ] + ] + }, + "ThingTypeName": "fp_demo_things" + }, + "Type": "AWS::IoT::Thing" + } + }, + "DeviceConfiguration": { + "Foo": "Bar" + } +} diff --git a/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_iot_thing_policy.json b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_iot_thing_policy.json new file mode 100644 index 000000000..15eb8e4ec --- /dev/null +++ b/FreeRTOS-Plus/Demo/AWS/Fleet_Provisioning_Windows_Simulator/Fleet_Provisioning_With_CSR_Demo/example_iot_thing_policy.json @@ -0,0 +1,10 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "iot:Connect", + "Resource": "arn:aws:iot:::*" + } + ] +}