AWS IoT

2022/08/04 - AWS IoT - 7 updated api methods

Changes  The release is to support attach a provisioning template to CACert for JITP function, Customer now doesn't have to hardcode a roleArn and templateBody during register a CACert to enable JITP.

CreateProvisioningTemplate (updated) Link ¶
Changes (request)
{'type': 'FLEET_PROVISIONING | JITP'}

Creates a provisioning template.

Requires permission to access the CreateProvisioningTemplate action.

See also: AWS API Documentation

Request Syntax

client.create_provisioning_template(
    templateName='string',
    description='string',
    templateBody='string',
    enabled=True|False,
    provisioningRoleArn='string',
    preProvisioningHook={
        'payloadVersion': 'string',
        'targetArn': 'string'
    },
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    type='FLEET_PROVISIONING'|'JITP'
)
type templateName

string

param templateName

[REQUIRED]

The name of the provisioning template.

type description

string

param description

The description of the provisioning template.

type templateBody

string

param templateBody

[REQUIRED]

The JSON formatted contents of the provisioning template.

type enabled

boolean

param enabled

True to enable the provisioning template, otherwise false.

type provisioningRoleArn

string

param provisioningRoleArn

[REQUIRED]

The role ARN for the role associated with the provisioning template. This IoT role grants permission to provision a device.

type preProvisioningHook

dict

param preProvisioningHook

Creates a pre-provisioning hook template.

  • payloadVersion (string) --

    The payload that was sent to the target function.

    Note: Only Lambda functions are currently supported.

  • targetArn (string) -- [REQUIRED]

    The ARN of the target function.

    Note: Only Lambda functions are currently supported.

type tags

list

param tags

Metadata which can be used to manage the provisioning template.

Note

For URI Request parameters use format: ...key1=value1&key2=value2...

For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

  • (dict) --

    A set of key/value pairs that are used to manage the resource.

    • Key (string) -- [REQUIRED]

      The tag's key.

    • Value (string) --

      The tag's value.

type type

string

param type

The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is FLEET_PROVISIONING . For more information about provisioning template, see: Provisioning template.

rtype

dict

returns

Response Syntax

{
    'templateArn': 'string',
    'templateName': 'string',
    'defaultVersionId': 123
}

Response Structure

  • (dict) --

    • templateArn (string) --

      The ARN that identifies the provisioning template.

    • templateName (string) --

      The name of the provisioning template.

    • defaultVersionId (integer) --

      The default version of the provisioning template.

DescribeCACertificate (updated) Link ¶
Changes (response)
{'registrationConfig': {'templateName': 'string'}}

Describes a registered CA certificate.

Requires permission to access the DescribeCACertificate action.

See also: AWS API Documentation

Request Syntax

client.describe_ca_certificate(
    certificateId='string'
)
type certificateId

string

param certificateId

[REQUIRED]

The CA certificate identifier.

rtype

dict

returns

Response Syntax

{
    'certificateDescription': {
        'certificateArn': 'string',
        'certificateId': 'string',
        'status': 'ACTIVE'|'INACTIVE',
        'certificatePem': 'string',
        'ownedBy': 'string',
        'creationDate': datetime(2015, 1, 1),
        'autoRegistrationStatus': 'ENABLE'|'DISABLE',
        'lastModifiedDate': datetime(2015, 1, 1),
        'customerVersion': 123,
        'generationId': 'string',
        'validity': {
            'notBefore': datetime(2015, 1, 1),
            'notAfter': datetime(2015, 1, 1)
        },
        'certificateMode': 'DEFAULT'|'SNI_ONLY'
    },
    'registrationConfig': {
        'templateBody': 'string',
        'roleArn': 'string',
        'templateName': 'string'
    }
}

Response Structure

  • (dict) --

    The output from the DescribeCACertificate operation.

    • certificateDescription (dict) --

      The CA certificate description.

      • certificateArn (string) --

        The CA certificate ARN.

      • certificateId (string) --

        The CA certificate ID.

      • status (string) --

        The status of a CA certificate.

      • certificatePem (string) --

        The CA certificate data, in PEM format.

      • ownedBy (string) --

        The owner of the CA certificate.

      • creationDate (datetime) --

        The date the CA certificate was created.

      • autoRegistrationStatus (string) --

        Whether the CA certificate configured for auto registration of device certificates. Valid values are "ENABLE" and "DISABLE"

      • lastModifiedDate (datetime) --

        The date the CA certificate was last modified.

      • customerVersion (integer) --

        The customer version of the CA certificate.

      • generationId (string) --

        The generation ID of the CA certificate.

      • validity (dict) --

        When the CA certificate is valid.

        • notBefore (datetime) --

          The certificate is not valid before this date.

        • notAfter (datetime) --

          The certificate is not valid after this date.

      • certificateMode (string) --

        The mode of the CA.

        All the device certificates that are registered using this CA will be registered in the same mode as the CA. For more information about certificate mode for device certificates, see certificate mode.

    • registrationConfig (dict) --

      Information about the registration configuration.

      • templateBody (string) --

        The template body.

      • roleArn (string) --

        The ARN of the role.

      • templateName (string) --

        The name of the provisioning template.

DescribeProvisioningTemplate (updated) Link ¶
Changes (response)
{'type': 'FLEET_PROVISIONING | JITP'}

Returns information about a provisioning template.

Requires permission to access the DescribeProvisioningTemplate action.

See also: AWS API Documentation

Request Syntax

client.describe_provisioning_template(
    templateName='string'
)
type templateName

string

param templateName

[REQUIRED]

The name of the provisioning template.

rtype

dict

returns

Response Syntax

{
    'templateArn': 'string',
    'templateName': 'string',
    'description': 'string',
    'creationDate': datetime(2015, 1, 1),
    'lastModifiedDate': datetime(2015, 1, 1),
    'defaultVersionId': 123,
    'templateBody': 'string',
    'enabled': True|False,
    'provisioningRoleArn': 'string',
    'preProvisioningHook': {
        'payloadVersion': 'string',
        'targetArn': 'string'
    },
    'type': 'FLEET_PROVISIONING'|'JITP'
}

Response Structure

  • (dict) --

    • templateArn (string) --

      The ARN of the provisioning template.

    • templateName (string) --

      The name of the provisioning template.

    • description (string) --

      The description of the provisioning template.

    • creationDate (datetime) --

      The date when the provisioning template was created.

    • lastModifiedDate (datetime) --

      The date when the provisioning template was last modified.

    • defaultVersionId (integer) --

      The default fleet template version ID.

    • templateBody (string) --

      The JSON formatted contents of the provisioning template.

    • enabled (boolean) --

      True if the provisioning template is enabled, otherwise false.

    • provisioningRoleArn (string) --

      The ARN of the role associated with the provisioning template. This IoT role grants permission to provision a device.

    • preProvisioningHook (dict) --

      Gets information about a pre-provisioned hook.

      • payloadVersion (string) --

        The payload that was sent to the target function.

        Note: Only Lambda functions are currently supported.

      • targetArn (string) --

        The ARN of the target function.

        Note: Only Lambda functions are currently supported.

    • type (string) --

      The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is FLEET_PROVISIONING . For more information about provisioning template, see: Provisioning template.

ListCACertificates (updated) Link ¶
Changes (request)
{'templateName': 'string'}

Lists the CA certificates registered for your Amazon Web Services account.

The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional results.

Requires permission to access the ListCACertificates action.

See also: AWS API Documentation

Request Syntax

client.list_ca_certificates(
    pageSize=123,
    marker='string',
    ascendingOrder=True|False,
    templateName='string'
)
type pageSize

integer

param pageSize

The result page size.

type marker

string

param marker

The marker for the next set of results.

type ascendingOrder

boolean

param ascendingOrder

Determines the order of the results.

type templateName

string

param templateName

The name of the provisioning template.

rtype

dict

returns

Response Syntax

{
    'certificates': [
        {
            'certificateArn': 'string',
            'certificateId': 'string',
            'status': 'ACTIVE'|'INACTIVE',
            'creationDate': datetime(2015, 1, 1)
        },
    ],
    'nextMarker': 'string'
}

Response Structure

  • (dict) --

    The output from the ListCACertificates operation.

    • certificates (list) --

      The CA certificates registered in your Amazon Web Services account.

      • (dict) --

        A CA certificate.

        • certificateArn (string) --

          The ARN of the CA certificate.

        • certificateId (string) --

          The ID of the CA certificate.

        • status (string) --

          The status of the CA certificate.

          The status value REGISTER_INACTIVE is deprecated and should not be used.

        • creationDate (datetime) --

          The date the CA certificate was created.

    • nextMarker (string) --

      The current position within the list of CA certificates.

ListProvisioningTemplates (updated) Link ¶
Changes (response)
{'templates': {'type': 'FLEET_PROVISIONING | JITP'}}

Lists the provisioning templates in your Amazon Web Services account.

Requires permission to access the ListProvisioningTemplates action.

See also: AWS API Documentation

Request Syntax

client.list_provisioning_templates(
    maxResults=123,
    nextToken='string'
)
type maxResults

integer

param maxResults

The maximum number of results to return at one time.

type nextToken

string

param nextToken

A token to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'templates': [
        {
            'templateArn': 'string',
            'templateName': 'string',
            'description': 'string',
            'creationDate': datetime(2015, 1, 1),
            'lastModifiedDate': datetime(2015, 1, 1),
            'enabled': True|False,
            'type': 'FLEET_PROVISIONING'|'JITP'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • templates (list) --

      A list of provisioning templates

      • (dict) --

        A summary of information about a provisioning template.

        • templateArn (string) --

          The ARN of the provisioning template.

        • templateName (string) --

          The name of the provisioning template.

        • description (string) --

          The description of the provisioning template.

        • creationDate (datetime) --

          The date when the provisioning template summary was created.

        • lastModifiedDate (datetime) --

          The date when the provisioning template summary was last modified.

        • enabled (boolean) --

          True if the fleet provision template is enabled, otherwise false.

        • type (string) --

          The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is FLEET_PROVISIONING . For more information about provisioning template, see: Provisioning template.

    • nextToken (string) --

      A token to retrieve the next set of results.

RegisterCACertificate (updated) Link ¶
Changes (request)
{'registrationConfig': {'templateName': 'string'}}

Registers a CA certificate with Amazon Web Services IoT Core. There is no limit to the number of CA certificates you can register in your Amazon Web Services account. You can register up to 10 CA certificates with the same CA subject field per Amazon Web Services account.

Requires permission to access the RegisterCACertificate action.

See also: AWS API Documentation

Request Syntax

client.register_ca_certificate(
    caCertificate='string',
    verificationCertificate='string',
    setAsActive=True|False,
    allowAutoRegistration=True|False,
    registrationConfig={
        'templateBody': 'string',
        'roleArn': 'string',
        'templateName': 'string'
    },
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    certificateMode='DEFAULT'|'SNI_ONLY'
)
type caCertificate

string

param caCertificate

[REQUIRED]

The CA certificate.

type verificationCertificate

string

param verificationCertificate

The private key verification certificate. If certificateMode is SNI_ONLY , the verificationCertificate field must be empty. If certificateMode is DEFAULT or not provided, the verificationCertificate field must not be empty.

type setAsActive

boolean

param setAsActive

A boolean value that specifies if the CA certificate is set to active.

Valid values: ACTIVE | INACTIVE

type allowAutoRegistration

boolean

param allowAutoRegistration

Allows this CA certificate to be used for auto registration of device certificates.

type registrationConfig

dict

param registrationConfig

Information about the registration configuration.

  • templateBody (string) --

    The template body.

  • roleArn (string) --

    The ARN of the role.

  • templateName (string) --

    The name of the provisioning template.

type tags

list

param tags

Metadata which can be used to manage the CA certificate.

Note

For URI Request parameters use format: ...key1=value1&key2=value2...

For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

  • (dict) --

    A set of key/value pairs that are used to manage the resource.

    • Key (string) -- [REQUIRED]

      The tag's key.

    • Value (string) --

      The tag's value.

type certificateMode

string

param certificateMode

Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the verificationCertificate field is not provided, set certificateMode to be SNI_ONLY . If the verificationCertificate field is provided, set certificateMode to be DEFAULT . When certificateMode is not provided, it defaults to DEFAULT . All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see certificate mode.

rtype

dict

returns

Response Syntax

{
    'certificateArn': 'string',
    'certificateId': 'string'
}

Response Structure

  • (dict) --

    The output from the RegisterCACertificateResponse operation.

    • certificateArn (string) --

      The CA certificate ARN.

    • certificateId (string) --

      The CA certificate identifier.

UpdateCACertificate (updated) Link ¶
Changes (request)
{'registrationConfig': {'templateName': 'string'}}

Updates a registered CA certificate.

Requires permission to access the UpdateCACertificate action.

See also: AWS API Documentation

Request Syntax

client.update_ca_certificate(
    certificateId='string',
    newStatus='ACTIVE'|'INACTIVE',
    newAutoRegistrationStatus='ENABLE'|'DISABLE',
    registrationConfig={
        'templateBody': 'string',
        'roleArn': 'string',
        'templateName': 'string'
    },
    removeAutoRegistration=True|False
)
type certificateId

string

param certificateId

[REQUIRED]

The CA certificate identifier.

type newStatus

string

param newStatus

The updated status of the CA certificate.

Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

type newAutoRegistrationStatus

string

param newAutoRegistrationStatus

The new value for the auto registration status. Valid values are: "ENABLE" or "DISABLE".

type registrationConfig

dict

param registrationConfig

Information about the registration configuration.

  • templateBody (string) --

    The template body.

  • roleArn (string) --

    The ARN of the role.

  • templateName (string) --

    The name of the provisioning template.

type removeAutoRegistration

boolean

param removeAutoRegistration

If true, removes auto registration.

returns

None