loggings
Creates, updates, deletes or gets a logging
resource or lists loggings
in a region
Overview
Name | loggings |
Type | Resource |
Description | Logging 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. |
Id | aws.iot.loggings |
Fields
Name | Datatype | Description |
---|---|---|
account_id | string | Your 12-digit account ID (used as the primary identifier for the CloudFormation resource). |
role_arn | string | The ARN of the role that allows IoT to write to Cloudwatch logs. |
default_log_level | string | The log level to use. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AccountId, RoleArn, DefaultLogLevel, 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 loggings
in a region.
SELECT
region,
account_id,
role_arn,
default_log_level
FROM aws.iot.loggings
WHERE region = 'us-east-1';
Gets all properties from an individual logging
.
SELECT
region,
account_id,
role_arn,
default_log_level
FROM aws.iot.loggings
WHERE region = 'us-east-1' AND data__Identifier = '<AccountId>';
INSERT
example
Use the following StackQL query and manifest file to create a new logging
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.loggings (
AccountId,
RoleArn,
DefaultLogLevel,
region
)
SELECT
'{{ AccountId }}',
'{{ RoleArn }}',
'{{ DefaultLogLevel }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.loggings (
AccountId,
RoleArn,
DefaultLogLevel,
region
)
SELECT
'{{ AccountId }}',
'{{ RoleArn }}',
'{{ DefaultLogLevel }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: logging
props:
- name: AccountId
value: '{{ AccountId }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: DefaultLogLevel
value: '{{ DefaultLogLevel }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iot.loggings
WHERE data__Identifier = '<AccountId>'
AND region = 'us-east-1';
Permissions
To operate on the loggings
resource, the following permissions are required:
Create
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole
Read
iot:GetV2LoggingOptions
Update
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole
Delete
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions
List
iot:GetV2LoggingOptions