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 | awscc.iot.resource_specific_loggings |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
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. |
For more information, see AWS::IoT::ResourceSpecificLogging.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | resource_specific_loggings | INSERT | TargetName, TargetType, LogLevel, region |
delete_resource | resource_specific_loggings | DELETE | Identifier, region |
update_resource | resource_specific_loggings | UPDATE | Identifier, PatchDocument, region |
list_resources | resource_specific_loggings_list_only | SELECT | region |
get_resource | resource_specific_loggings | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual resource_specific_logging.
SELECT
region,
target_type,
target_name,
log_level,
target_id
FROM awscc.iot.resource_specific_loggings
WHERE
region = 'us-east-1' AND
Identifier = '{{ target_id }}';
Lists all resource_specific_loggings in a region.
SELECT
region,
target_id
FROM awscc.iot.resource_specific_loggings_list_only
WHERE
region = 'us-east-1';
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 awscc.iot.resource_specific_loggings (
TargetType,
TargetName,
LogLevel,
region
)
SELECT
'{{ target_type }}',
'{{ target_name }}',
'{{ log_level }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.resource_specific_loggings (
TargetType,
TargetName,
LogLevel,
region
)
SELECT
'{{ target_type }}',
'{{ target_name }}',
'{{ log_level }}',
'{{ 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: target_type
value: '{{ target_type }}'
- name: target_name
value: '{{ target_name }}'
- name: log_level
value: '{{ log_level }}'
UPDATE example
Use the following StackQL query and manifest file to update a resource_specific_logging resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.resource_specific_loggings
SET PatchDocument = string('{{ {
"LogLevel": log_level
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ target_id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.resource_specific_loggings
WHERE
Identifier = '{{ target_id }}' AND
region = 'us-east-1';
Permissions
To operate on the resource_specific_loggings resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iot:ListV2LoggingLevels,
iot:SetV2LoggingLevel
iot:ListV2LoggingLevels
iot:ListV2LoggingLevels,
iot:SetV2LoggingLevel
iot:ListV2LoggingLevels,
iot:DeleteV2LoggingLevel
iot:ListV2LoggingLevels