|
1 | 1 | ## Setup for Fleet Provisioning Demos |
2 | 2 |
|
3 | | -### Creating the Provisioning Policy |
4 | | - |
5 | | -1. Login to your AWS account and open AWS IoT Core. On the side bar click on security > policies > create policy |
6 | | -2. Set a relevant policy name |
7 | | -3. Copy the contents in the demos/fleet_provisioning/fleet_provisioning_with_csr(or fleet_provisioning_keys_cert_demo)/example_claim_policy.json and paste it in the policy document on the AWS console. |
8 | | -4. Create the policy |
9 | | - |
10 | | - |
11 | | -### Creating the Claim Certificate |
12 | | - |
13 | | -1. On the side bar of the AWS IoT Core click on security > certificates > add certificate. Make the “Certificate Status” active and download the certificate files from the prompt given. |
14 | | -2. Set the value of the macro CLAIM_CERT_PATH in the democonfig.h file to the path of the certificate downloaded and set the value of the macro CLAIM_PRIVATE_KEY_PATH in the democonfig.h file to the path of the private key downloaded. Alternatively you can set the values of these through command line parameters. |
15 | | -3. Now click on the certificate > attach policies > select your provisioning policy made in the previous section and select attach policy. |
16 | | - |
17 | | - |
18 | | -### Creating the IAM role for AWS IoT to create resources |
19 | | - |
20 | | -1. Go to the IAM Identity center and create a new IAM role |
21 | | -2. Select AWS IoT when asked to select a service |
22 | | - |
23 | | - |
24 | | -### Creating Fleet Provisioning Template |
25 | | - |
26 | | -1. Go to AWS IoT Core > Connect many devices > Connect many devices > create provisioning template. |
27 | | -2. Select Provisioning devices with claim certificates > next |
28 | | -3. Set the status to active |
29 | | -4. Enter template name |
30 | | -5. Enter the IAM role you created in the previous section or you can create a new one if you have not yet created it |
31 | | -6. Enter the provisioning policy that you made in the very first section or create a new one if you havn’t already |
32 | | -7. We do not need to do any pre-provisioning stuff hence we will select “Don’t use a pre-provisioning action” |
33 | | -8. Turn the automatic thing creation option on and click next |
34 | | -9. Select a policy that you wish your device should have when it is running (Permissions to connet to IoT, subscribe to some topic, publish to some topic extra) or make a new one if you do not have one already. |
35 | | -10. Click next, review and create. |
36 | | - |
37 | | -### Configuring the demo |
38 | | -Set all the necessary macro values in the demo_config.h file or alternatively you can set the values of these through command line parameters. |
39 | | - |
| 3 | +### Create the Provisioning Policy |
| 4 | + |
| 5 | +1. Log in to your AWS account and open AWS IoT Core. |
| 6 | +2. Navigate to Security > Policies > Create policy. |
| 7 | +3. Enter a relevant policy name. |
| 8 | +4. Copy the contents from demos/fleet_provisioning/fleet_provisioning_with_csr (or fleet_provisioning_keys_cert_demo)/example_claim_policy.json. |
| 9 | +5. Paste the copied content into the policy document on the AWS console. |
| 10 | +6. Click "Create policy". |
| 11 | + |
| 12 | +### Create the Claim Certificate |
| 13 | +1. In AWS IoT Core, go to Security > Certificates > Add certificate. |
| 14 | +2. Set the "Certificate Status" to active. |
| 15 | +3. Download the certificate files from the provided prompt. |
| 16 | +4. Update the demo_config.h file: |
| 17 | + - Set CLAIM_CERT_PATH to the path of the downloaded certificate. |
| 18 | + - Set CLAIM_PRIVATE_KEY_PATH to the path of the downloaded private key. Note: You can also set these values using command line parameters. |
| 19 | +5. Select the certificate, click "Attach policies", choose your provisioning policy, and click "Attach policy". |
| 20 | + |
| 21 | +### Create the IAM Role for AWS IoT |
| 22 | +1. Go to the IAM Identity Center. |
| 23 | +2. Create a new IAM role. |
| 24 | +3. When prompted, select AWS IoT as the service. |
| 25 | + |
| 26 | +### Create Fleet Provisioning Template |
| 27 | +1. Navigate to AWS IoT Core > Connect many devices > Connect many devices > Create provisioning template. |
| 28 | +2. Choose "Provisioning devices with claim certificates" and click "Next". |
| 29 | +3. Set the status to active. |
| 30 | +4. Enter a template name. |
| 31 | +5. Select the IAM role you created earlier (or create a new one if needed). |
| 32 | +6. Choose the provisioning policy you created earlier (or create a new one if needed). |
| 33 | +7. Select "Don't use a pre-provisioning action". |
| 34 | +8. Enable the automatic thing creation option and click "Next". |
| 35 | +9. Select or create a policy for your device's permissions (e.g., connecting to IoT, subscribing/publishing to topics). |
| 36 | +10. Click "Next", review the settings, and create the template. |
| 37 | + |
| 38 | +### Configure the Demo |
| 39 | +Set all necessary macro values in the demo_config.h file. Alternatively, you can provide these values through command line parameters. |
0 commit comments