CreateProvisioningTemplateVersionCommand

Creates a new version of a provisioning template.

Requires permission to access the CreateProvisioningTemplateVersion  action.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IoTClient, CreateProvisioningTemplateVersionCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, CreateProvisioningTemplateVersionCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // CreateProvisioningTemplateVersionRequest
  templateName: "STRING_VALUE", // required
  templateBody: "STRING_VALUE", // required
  setAsDefault: true || false,
};
const command = new CreateProvisioningTemplateVersionCommand(input);
const response = await client.send(command);
// { // CreateProvisioningTemplateVersionResponse
//   templateArn: "STRING_VALUE",
//   templateName: "STRING_VALUE",
//   versionId: Number("int"),
//   isDefaultVersion: true || false,
// };

CreateProvisioningTemplateVersionCommand Input

Parameter
Type
Description
templateBody
Required
string | undefined

The JSON formatted contents of the provisioning template.

templateName
Required
string | undefined

The name of the provisioning template.

setAsDefault
boolean | undefined

Sets a fleet provision template version as the default version.

CreateProvisioningTemplateVersionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
isDefaultVersion
boolean | undefined

True if the provisioning template version is the default version, otherwise false.

templateArn
string | undefined

The ARN that identifies the provisioning template.

templateName
string | undefined

The name of the provisioning template.

versionId
number | undefined

The version of the provisioning template.

Throws

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.

ThrottlingException
client

The rate exceeds the limit.

UnauthorizedException
client

You are not authorized to perform this operation.

VersionsLimitExceededException
client

The number of policy versions exceeds the limit.

IoTServiceException
Base exception class for all service exceptions from IoT service.