Skip to main content

loggings

Creates, updates, deletes or gets a logging resource or lists loggings in a region

Overview

Nameloggings
TypeResource
DescriptionLogging Options enable you to configure your IoT V2 logging role and default logging level so that you can monitor progress events logs as it passes from your devices through Iot core service.
Idawscc.iot.loggings

Fields

NameDatatypeDescription
account_idstringYour 12-digit account ID (used as the primary identifier for the CloudFormation resource).
role_arnstringThe ARN of the role that allows IoT to write to Cloudwatch logs.
default_log_levelstringThe log level to use. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourceloggingsINSERTAccountId, RoleArn, DefaultLogLevel, region
delete_resourceloggingsDELETEIdentifier, region
update_resourceloggingsUPDATEIdentifier, PatchDocument, region
list_resourcesloggings_list_onlySELECTregion
get_resourceloggingsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual logging.

SELECT
region,
account_id,
role_arn,
default_log_level
FROM awscc.iot.loggings
WHERE
region = 'us-east-1' AND
Identifier = '{{ account_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iot.loggings (
AccountId,
RoleArn,
DefaultLogLevel,
region
)
SELECT
'{{ account_id }}',
'{{ role_arn }}',
'{{ default_log_level }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a logging resource, using stack-deploy.

/*+ update */
UPDATE awscc.iot.loggings
SET PatchDocument = string('{{ {
"RoleArn": role_arn,
"DefaultLogLevel": default_log_level
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ account_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.iot.loggings
WHERE
Identifier = '{{ account_id }}' AND
region = 'us-east-1';

Permissions

To operate on the loggings resource, the following permissions are required:

iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole