ALIYUN::IOT::Device is used to register a device.
Supported regions:
- China (Shanghai)
- Singapore (Singapore)
- Japan (Tokyo)
- Germany (Frankfurt)
- US (Silicon Valley)
- US (Virginia)
Syntax
{
"Type": "ALIYUN::IOT::Device",
"Properties": {
"DeviceName": String,
"IotInstanceId": String,
"ProductKey": String,
"PinCode": String,
"DevEui": String,
"Nickname": String
}
}
Properties
| Parameter | Type | Required | Editable | Description | Constraint |
| DeviceName | String | No | Released | The device name. If not specified, the system randomly generates a name. | The password must be 4 to 32 characters in length and can contain letters, digits, and the following special characters:
|
| IotInstanceId | String | No | Released | The ID of the instance. | Not required for public instances. |
| ProductKey | String | Yes | Not supported | The identifier of the product to which the device belongs. ProductKey is a globally unique IoT Platform identifier. You can view the domain name in the IoT Platform console or call QueryProductList to view all products under your account. |
None |
| PinCode | String | No | Released | The LoRaWAN PIN code used to verify the DevEUI. | Required when creating a LoRaWAN device. |
| DevEui | String | No | Released | The DevEUI of the LoRaWAN device. | Required when creating a LoRaWAN device. |
| Nickname | String | No | Released | The device alias. If not specified, no alias is generated. | Must be 4 to 64 characters. Can contain letters, digits, and underscores (_). Note A Chinese character occupies 2 characters. |
Return values
Fn::GetAtt
- DeviceName: Device name.
- NodeType: The node type of the product.
- IotInstanceId: The ID of the instance.
- ProductKey: The product key.
- NickName: The device alias.
- IotId: The globally unique ID issued by IoT Platform for the device.
- ProductName: The name of the product.
- DeviceSecret: Device secret.
- IpAddress: The IP address.
Examples
JSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Device": {
"Type": "ALIYUN::IOT::Device",
"Properties": {
"DeviceName": {
"Ref": "DeviceName"
},
"IotInstanceId": {
"Ref": "IotInstanceId"
},
"ProductKey": {
"Ref": "ProductKey"
},
"PinCode": {
"Ref": "PinCode"
},
"DevEui": {
"Ref": "DevEui"
},
"Nickname": {
"Ref": "Nickname"
}
}
}
},
"Parameters": {
"DeviceName": {
"Type": "String",
"Description": "The name of the device that you want to register. The device name must consist of\n4 to 32 characters, including English letters, digits, and special characters, for\nexample, hyphens (-), underscores (_), at signs (@), periods (.) , and colons (:).\nDeviceName is used with ProductKey to identify a specified device.\nNote If you do not specify this parameter, the system will generate a name for the device."
},
"IotInstanceId": {
"Type": "String",
"Description": "Public instance does not pass this parameter; instance that you need to buy the incoming instance ID."
},
"ProductKey": {
"Type": "String",
"Description": "The identifier of the product to which the device to be registered belongs."
},
"PinCode": {
"Type": "String",
"Description": "PIN Code LoRaWAN device for checking the legitimacy of DevEUI.\nWhen you create a LoRaWAN devices, this will pass."
},
"DevEui": {
"Type": "String",
"Description": "DevEUI LoRaWAN equipment.\nWhen you create a LoRaWAN devices, this will pass."
},
"Nickname": {
"Type": "String",
"Description": "Add a nickname for the device. A nickname can be 4-64 characters in length, and can\ncontain Chinese characters, English letters, numbers and underscores (_). A Chinese\ncharacter counts as two characters."
}
},
"Outputs": {
"DeviceName": {
"Description": "Device name.",
"Value": {
"Fn::GetAtt": [
"Device",
"DeviceName"
]
}
},
"NodeType": {
"Description": "Node type.",
"Value": {
"Fn::GetAtt": [
"Device",
"NodeType"
]
}
},
"IotInstanceId": {
"Description": "IOT instance ID.",
"Value": {
"Fn::GetAtt": [
"Device",
"IotInstanceId"
]
}
},
"ProductKey": {
"Description": "Product key.",
"Value": {
"Fn::GetAtt": [
"Device",
"ProductKey"
]
}
},
"IpAddress": {
"Description": "IP address.",
"Value": {
"Fn::GetAtt": [
"Device",
"IpAddress"
]
}
},
"DeviceSecret": {
"Description": "Device key.",
"Value": {
"Fn::GetAtt": [
"Device",
"DeviceSecret"
]
}
},
"ProductName": {
"Description": "Product name.",
"Value": {
"Fn::GetAtt": [
"Device",
"ProductName"
]
}
},
"IotId": {
"Description": "Things internet device ID issued for the device, as the unique identifier of the device.\nDescription Keep, do not leak.",
"Value": {
"Fn::GetAtt": [
"Device",
"IotId"
]
}
},
"NickName": {
"Description": "Nick name.",
"Value": {
"Fn::GetAtt": [
"Device",
"NickName"
]
}
}
}
}
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Device:
Type: 'ALIYUN::IOT::Device'
Properties:
DeviceName:
Ref: DeviceName
IotInstanceId:
Ref: IotInstanceId
ProductKey:
Ref: ProductKey
PinCode:
Ref: PinCode
DevEui:
Ref: DevEui
Nickname:
Ref: Nickname
Parameters:
DeviceName:
Type: String
Description: >-
The name of the device that you want to register. The device name must
consist of
4 to 32 characters, including English letters, digits, and special
characters, for
example, hyphens (-), underscores (_), at signs (@), periods (.) , and
colons (:).
DeviceName is used with ProductKey to identify a specified device.
Note If you do not specify this parameter and the system will generate a name
for the device.
IotInstanceId:
Type: String
Description: >-
Public instance does not pass this parameter; instance that you need to
buy the incoming instance ID.
ProductKey:
Type: String
Description: >-
The identifier of the product to which the device to be registered
belongs.
PinCode:
Type: String
Description: |-
PIN Code LoRaWAN device for checking the legitimacy of DevEUI.
When you create a LoRaWAN devices, this will pass.
DevEui:
Type: String
Description: |-
DevEUI LoRaWAN equipment.
When you create a LoRaWAN devices, this will pass.
Nickname:
Type: String
Description: >-
Add a nickname for the device. A nickname can be 4-64 characters in
length, and can
contain Chinese characters, English letters, numbers and underscores (_).
A Chinese
character counts as two characters.
Outputs:
DeviceName:
Description: Device name.
Value:
'Fn::GetAtt':
-Device
-DeviceName
NodeType:
Description: Node type.
Value:
'Fn::GetAtt':
-Device
-NodeType
IotInstanceId:
Description: IOT instance ID.
Value:
'Fn::GetAtt':
-Device
-IotInstanceId
ProductKey:
Description: Product key.
Value:
'Fn::GetAtt':
-Device
-ProductKey
IpAddress:
Description: IP address.
Value:
'Fn::GetAtt':
-Device
-IpAddress
DeviceSecret:
Description: Device key.
Value:
'Fn::GetAtt':
-Device
-DeviceSecret
ProductName:
Description: Product name.
Value:
'Fn::GetAtt':
-Device
-ProductName
IotId:
Description: >-
Things internet device ID issued for the device and as the unique identifier
of the device.
Description Keep, do not leak.
Value:
'Fn::GetAtt':
-Device
-IotId
NickName:
Description: Nick name.
Value:
'Fn::GetAtt':
-Device
-NickName
该文章对您有帮助吗?