resource_specific_loggings
Creates, updates, deletes or gets a resource_specific_logging
resource or lists resource_specific_loggings
in a region
Overview
Name | resource_specific_loggings |
Type | Resource |
Description | Resource-specific logging allows you to specify a logging level for a specific thing group. |
Id | aws.iot.resource_specific_loggings |
Fields
Name | Datatype | Description |
---|---|---|
target_type | string | The target type. Value must be THING_GROUP, CLIENT_ID, SOURCE_IP, PRINCIPAL_ID, or EVENT_TYPE. |
target_name | string | The target name. |
log_level | string | The log level for a specific target. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED. |
target_id | string | Unique Id for a Target (TargetType:TargetName), this will be internally built to serve as primary identifier for a log target. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | TargetName, TargetType, LogLevel, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all resource_specific_loggings
in a region.
SELECT
region,
target_type,
target_name,
log_level,
target_id
FROM aws.iot.resource_specific_loggings
WHERE region = 'us-east-1';
Gets all properties from an individual resource_specific_logging
.
SELECT
region,
target_type,
target_name,
log_level,
target_id
FROM aws.iot.resource_specific_loggings
WHERE region = 'us-east-1' AND data__Identifier = '<TargetId>';
INSERT
example
Use the following StackQL query and manifest file to create a new resource_specific_logging
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.resource_specific_loggings (
TargetType,
TargetName,
LogLevel,
region
)
SELECT
'{{ TargetType }}',
'{{ TargetName }}',
'{{ LogLevel }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.resource_specific_loggings (
TargetType,
TargetName,
LogLevel,
region
)
SELECT
'{{ TargetType }}',
'{{ TargetName }}',
'{{ LogLevel }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: resource_specific_logging
props:
- name: TargetType
value: '{{ TargetType }}'
- name: TargetName
value: '{{ TargetName }}'
- name: LogLevel
value: '{{ LogLevel }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iot.resource_specific_loggings
WHERE data__Identifier = '<TargetId>'
AND region = 'us-east-1';
Permissions
To operate on the resource_specific_loggings
resource, the following permissions are required:
Create
iot:ListV2LoggingLevels,
iot:SetV2LoggingLevel
Read
iot:ListV2LoggingLevels
Update
iot:ListV2LoggingLevels,
iot:SetV2LoggingLevel
Delete
iot:ListV2LoggingLevels,
iot:DeleteV2LoggingLevel
List
iot:ListV2LoggingLevels