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 = '{{ region }}' 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 = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.networkmanager.devices
WHERE
Identifier = '{{ global_network_id }}|{{ device_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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