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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

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

iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole