Skip to main content

resource_specific_loggings

Creates, updates, deletes or gets a resource_specific_logging resource or lists resource_specific_loggings in a region

Overview

Nameresource_specific_loggings
TypeResource
DescriptionResource-specific logging allows you to specify a logging level for a specific thing group.
Idawscc.iot.resource_specific_loggings

Fields

NameDatatypeDescription
target_typestringThe target type. Value must be THING_GROUP, CLIENT_ID, SOURCE_IP, PRINCIPAL_ID, or EVENT_TYPE.
target_namestringThe target name.
log_levelstringThe log level for a specific target. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED.
target_idstringUnique Id for a Target (TargetType:TargetName), this will be internally built to serve as primary identifier for a log target.
regionstringAWS region.

For more information, see AWS::IoT::ResourceSpecificLogging.

Methods

NameResourceAccessible byRequired Params
create_resourceresource_specific_loggingsINSERTTargetName, TargetType, LogLevel, region
delete_resourceresource_specific_loggingsDELETEIdentifier, region
update_resourceresource_specific_loggingsUPDATEIdentifier, PatchDocument, region
list_resourcesresource_specific_loggings_list_onlySELECTregion
get_resourceresource_specific_loggingsSELECTIdentifier, region

SELECT examples

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 = '{{ region }}' AND
Identifier = '{{ target_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iot.resource_specific_loggings (
TargetType,
TargetName,
LogLevel,
region
)
SELECT
'{{ target_type }}',
'{{ target_name }}',
'{{ log_level }}',
'{{ 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 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iot.resource_specific_loggings
WHERE
Identifier = '{{ target_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 resource_specific_loggings resource, the following permissions are required:

iot:ListV2LoggingLevels,
iot:SetV2LoggingLevel