devices
Creates, updates, deletes or gets a device resource or lists devices in a region
Overview
| Name | devices |
| Type | Resource |
| Description | The AWS::NetworkManager::Device type describes a device. |
| Id | awscc.networkmanager.devices |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
device_arn | string | The Amazon Resource Name (ARN) of the device. |
device_id | string | The ID of the device. |
description | string | The description of the device. |
tags | array | The tags for the device. |
global_network_id | string | The ID of the global network. |
aws_location | object | The Amazon Web Services location of the device, if applicable. |
location | object | The site location. |
model | string | The device model |
serial_number | string | The device serial number. |
site_id | string | The site ID. |
type | string | The device type. |
vendor | string | The device vendor. |
created_at | string | The date and time that the device was created. |
state | string | The state of the device. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
device_id | string | The ID of the device. |
global_network_id | string | The ID of the global network. |
region | string | AWS region. |
For more information, see AWS::NetworkManager::Device.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | devices | INSERT | GlobalNetworkId, region |
delete_resource | devices | DELETE | Identifier, region |
update_resource | devices | UPDATE | Identifier, PatchDocument, region |
list_resources | devices_list_only | SELECT | region |
get_resource | devices | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual device.
SELECT
region,
device_arn,
device_id,
description,
tags,
global_network_id,
aws_location,
location,
model,
serial_number,
site_id,
type,
vendor,
created_at,
state
FROM awscc.networkmanager.devices
WHERE
region = 'us-east-1' AND
Identifier = '{{ global_network_id }}|{{ device_id }}';
Lists all devices in a region.
SELECT
region,
global_network_id,
device_id
FROM awscc.networkmanager.devices_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new device resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.networkmanager.devices (
GlobalNetworkId,
region
)
SELECT
'{{ global_network_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.networkmanager.devices (
Description,
Tags,
GlobalNetworkId,
AWSLocation,
Location,
Model,
SerialNumber,
SiteId,
Type,
Vendor,
region
)
SELECT
'{{ description }}',
'{{ tags }}',
'{{ global_network_id }}',
'{{ aws_location }}',
'{{ location }}',
'{{ model }}',
'{{ serial_number }}',
'{{ site_id }}',
'{{ type }}',
'{{ vendor }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: device
props:
- name: description
value: '{{ description }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: global_network_id
value: '{{ global_network_id }}'
- name: aws_location
value:
zone: '{{ zone }}'
subnet_arn: '{{ subnet_arn }}'
- name: location
value:
address: '{{ address }}'
latitude: '{{ latitude }}'
longitude: '{{ longitude }}'
- name: model
value: '{{ model }}'
- name: serial_number
value: '{{ serial_number }}'
- name: site_id
value: '{{ site_id }}'
- name: type
value: '{{ type }}'
- name: vendor
value: '{{ vendor }}'
UPDATE example
Use the following StackQL query and manifest file to update a device resource, using stack-deploy.
/*+ update */
UPDATE awscc.networkmanager.devices
SET PatchDocument = string('{{ {
"Description": description,
"Tags": tags,
"AWSLocation": aws_location,
"Location": location,
"Model": model,
"SerialNumber": serial_number,
"SiteId": site_id,
"Type": type,
"Vendor": vendor
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ global_network_id }}|{{ device_id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.networkmanager.devices
WHERE
Identifier = '{{ global_network_id }}|{{ device_id }}' AND
region = 'us-east-1';
Permissions
To operate on the devices resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
networkmanager:CreateDevice,
networkmanager:GetDevices,
networkmanager:TagResource
networkmanager:GetDevices
networkmanager:UpdateDevice,
networkmanager:ListTagsForResource,
networkmanager:GetDevices,
networkmanager:TagResource,
networkmanager:UntagResource
networkmanager:GetDevices,
networkmanager:DeleteDevice
networkmanager:GetDevices