Provisioning Templates

A provision template is a JSON document that uses parameters to describe the resources
your device must use to interact with AWS IoT. A template contains two sections:
Parameters and Resources.

Parameters Section

The Parameters section declares the parameters used within the
Resources section. Each parameter declares a name, a type, and an
optional default value. The default value is used when the dictionary passed in with
the template does not contain a value for the parameter. The Parameters
section of a template document looks like the following:

This template snippet declares four parameters: ThingName,
SerialNumber, Location, and CSR. All of
these parameters are of type String. The Location
parameter declares a default value of "WA".

Resources Section

The Resources section of the template declares the resources required
for your device to communicate with AWS IoT: a thing, a certificate, and one or more
policies. Each resource specifies a logical name, a type, and a set of
properties.

A logical name allows you to refer to a resource elsewhere in the template.

The type specifies the kind of resource you are declaring. Valid types are:

AWS::IoT::Thing

AWS::IoT::Certificate

AWS::IoT::Policy

The properties you specify depend on the type of resource you are
declaring.

Thing Resources

Thing resources are declared using the following properties:

ThingName: String.

AttributePayload: A list of name/value pairs.

ThingTypeName: Optional. String for an associated thing
type for the thing.

ThingGroups: Optional. A list of groups to which the
thing belongs.

Certificate Resources

Certificates can be specified in one of the following ways:

A certificate signing request (CSR).

A certificate ID of an existing device certificate.

A device certificate created with a CA certificate registered with
AWS IoT. If you have more than one CA certificate registered with the same
subject field, you must also pass in the CA certificate used to sign the
device certificate.

Note

When you declare a certificate in a template, use only one of the
preceding methods. If you use a CSR, you cannot also specify a certificate
ID or a device certificate.