- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateProvisioningTemplateCommand
Updates a provisioning template.
Requires permission to access the UpdateProvisioningTemplate action.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTClient, UpdateProvisioningTemplateCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, UpdateProvisioningTemplateCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // UpdateProvisioningTemplateRequest
templateName: "STRING_VALUE", // required
description: "STRING_VALUE",
enabled: true || false,
defaultVersionId: Number("int"),
provisioningRoleArn: "STRING_VALUE",
preProvisioningHook: { // ProvisioningHook
payloadVersion: "STRING_VALUE",
targetArn: "STRING_VALUE", // required
},
removePreProvisioningHook: true || false,
};
const command = new UpdateProvisioningTemplateCommand(input);
const response = await client.send(command);
// {};
UpdateProvisioningTemplateCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
templateName Required | string | undefined | The name of the provisioning template. |
defaultVersionId | number | undefined | The ID of the default provisioning template version. |
description | string | undefined | The description of the provisioning template. |
enabled | boolean | undefined | True to enable the provisioning template, otherwise false. |
preProvisioningHook | ProvisioningHook | undefined | Updates the pre-provisioning hook template. Only supports template of type |
provisioningRoleArn | string | undefined | The ARN of the role associated with the provisioning template. This IoT role grants permission to provision a device. |
removePreProvisioningHook | boolean | undefined | Removes pre-provisioning hook template. |
UpdateProvisioningTemplateCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ConflictingResourceUpdateException | client | A conflicting resource update exception. This exception is thrown when two pending updates cause a conflict. |
InternalFailureException | server | An unexpected error has occurred. |
InvalidRequestException | client | The request is not valid. |
ResourceNotFoundException | client | The specified resource does not exist. |
UnauthorizedException | client | You are not authorized to perform this operation. |
IoTServiceException | Base exception class for all service exceptions from IoT service. |