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 | awscc.iot.loggings |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | Your 12-digit account ID (used as the primary identifier for the CloudFormation resource). |
region | string | AWS region. |
For more information, see AWS::IoT::Logging.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | loggings | INSERT | AccountId, RoleArn, DefaultLogLevel, region |
delete_resource | loggings | DELETE | Identifier, region |
update_resource | loggings | UPDATE | Identifier, PatchDocument, region |
list_resources | loggings_list_only | SELECT | region |
get_resource | loggings | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all loggings in a region.
SELECT
region,
account_id
FROM awscc.iot.loggings_list_only
WHERE
region = 'us-east-1';
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 awscc.iot.loggings (
AccountId,
RoleArn,
DefaultLogLevel,
region
)
SELECT
'{{ account_id }}',
'{{ role_arn }}',
'{{ default_log_level }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.loggings (
AccountId,
RoleArn,
DefaultLogLevel,
region
)
SELECT
'{{ account_id }}',
'{{ role_arn }}',
'{{ default_log_level }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: logging
props:
- name: account_id
value: '{{ account_id }}'
- name: role_arn
value: '{{ role_arn }}'
- name: default_log_level
value: '{{ default_log_level }}'
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:
- Create
- Read
- Update
- Delete
- List
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole
iot:GetV2LoggingOptions
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions,
iam:PassRole
iot:SetV2LoggingOptions,
iot:GetV2LoggingOptions
iot:GetV2LoggingOptions