- Follow the instructions in the root-level README to configure the dependencies on the AWS Console.
- Refer this section for the samples on IoT policies and provisioning templates.
- Clone the repository to the edge device.
- Run
dotnet restore dotnet-core/AWS.IoT.FleetProvisioning/AWS.IoT.FleetProvisioning.csproj
to install the NuGet dependencies. - Place the downloaded bootstrap credentials on your device (at the
dotnet-core/AWS.IoT.FleetProvisioning/Certs/
folder) beside theroot.ca.pem
file. - Update
dotnet-core/AWS.IoT.FleetProvisioning/appsettings.json
to configure the below parameters:
"settings": {
// absolute path to the folder containing your certificates
"secureCertificatePath": "/PATH/TO/CERTS",
// names for root certificate, provisioning claim certificate, and private key.
"rootCertificate": "root.ca.pem",
"claimCertificate": "bootstrap-certificate.pem.crt",
"claimCertificateKey": "bootstrap-private.pem.key",
// IoT Data:ATS Endpoint (run `aws iot describe-endpoint --endpoint-type iot:Data-ATS` to get this value)
"iotEndpoint": "xxxxxxxxxxxxxx-ats.iot.{REGION}.amazonaws.com",
// name for the provisioning template that was created in IoT Core
"provisioningTemplate": "Provisioning-Template"
}
- Change into the project directory:
cd dotnet-core/AWS.IoT.FleetProvisioning
- Run the solution:
dotnet run
If the solution runs without errors, you will notice that the new certificates are saved in secureCertificatePath
directory. You will also notice that new "Thing" has been created and activated in the IoT Registry. As this is only meant to be a demo, each subsequent run will use the original bootstrap cert to request new credentials, and therefore will create new "Things". Thing names are based on dynamically generated "serial numbers" (which are just new Guid
s) as can be seen in the code.