Skip to main content

devices

Creates, updates, deletes or gets a device resource or lists devices in a region

Overview

Namedevices
TypeResource
DescriptionThe AWS::NetworkManager::Device type describes a device.
Idawscc.networkmanager.devices

Fields

NameDatatypeDescription
device_arnstringThe Amazon Resource Name (ARN) of the device.
device_idstringThe ID of the device.
descriptionstringThe description of the device.
tagsarrayThe tags for the device.
global_network_idstringThe ID of the global network.
aws_locationobjectThe Amazon Web Services location of the device, if applicable.
locationobjectThe site location.
modelstringThe device model
serial_numberstringThe device serial number.
site_idstringThe site ID.
typestringThe device type.
vendorstringThe device vendor.
created_atstringThe date and time that the device was created.
statestringThe state of the device.
regionstringAWS region.

For more information, see AWS::NetworkManager::Device.

Methods

NameResourceAccessible byRequired Params
create_resourcedevicesINSERTGlobalNetworkId, region
delete_resourcedevicesDELETEIdentifier, region
update_resourcedevicesUPDATEIdentifier, PatchDocument, region
list_resourcesdevices_list_onlySELECTregion
get_resourcedevicesSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new device resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.networkmanager.devices (
GlobalNetworkId,
region
)
SELECT
'{{ global_network_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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:

ParameterDescription
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:

networkmanager:CreateDevice,
networkmanager:GetDevices,
networkmanager:TagResource