mitigation_actions
Creates, updates, deletes or gets a mitigation_action
resource or lists mitigation_actions
in a region
Overview
Name | mitigation_actions |
Type | Resource |
Description | Mitigation actions can be used to take actions to mitigate issues that were found in an Audit finding or Detect violation. |
Id | aws.iot.mitigation_actions |
Fields
Name | Datatype | Description |
---|---|---|
action_name | string | A unique identifier for the mitigation action. |
role_arn | string | |
tags | array | An array of key-value pairs to apply to this resource. |
action_params | object | The set of parameters for this mitigation action. You can specify only one type of parameter (in other words, you can apply only one action for each defined mitigation action). |
mitigation_action_arn | string | |
mitigation_action_id | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RoleArn, ActionParams, 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 mitigation_actions
in a region.
SELECT
region,
action_name,
role_arn,
tags,
action_params,
mitigation_action_arn,
mitigation_action_id
FROM aws.iot.mitigation_actions
WHERE region = 'us-east-1';
Gets all properties from an individual mitigation_action
.
SELECT
region,
action_name,
role_arn,
tags,
action_params,
mitigation_action_arn,
mitigation_action_id
FROM aws.iot.mitigation_actions
WHERE region = 'us-east-1' AND data__Identifier = '<ActionName>';
INSERT
example
Use the following StackQL query and manifest file to create a new mitigation_action
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.mitigation_actions (
RoleArn,
ActionParams,
region
)
SELECT
'{{ RoleArn }}',
'{{ ActionParams }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.mitigation_actions (
ActionName,
RoleArn,
Tags,
ActionParams,
region
)
SELECT
'{{ ActionName }}',
'{{ RoleArn }}',
'{{ Tags }}',
'{{ ActionParams }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: mitigation_action
props:
- name: ActionName
value: '{{ ActionName }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: ActionParams
value:
AddThingsToThingGroupParams:
OverrideDynamicGroups: '{{ OverrideDynamicGroups }}'
ThingGroupNames:
- '{{ ThingGroupNames[0] }}'
EnableIoTLoggingParams:
LogLevel: '{{ LogLevel }}'
RoleArnForLogging: '{{ RoleArnForLogging }}'
PublishFindingToSnsParams:
TopicArn: '{{ TopicArn }}'
ReplaceDefaultPolicyVersionParams:
TemplateName: '{{ TemplateName }}'
UpdateCACertificateParams:
Action: '{{ Action }}'
UpdateDeviceCertificateParams:
Action: '{{ Action }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iot.mitigation_actions
WHERE data__Identifier = '<ActionName>'
AND region = 'us-east-1';
Permissions
To operate on the mitigation_actions
resource, the following permissions are required:
Create
iot:CreateMitigationAction,
iot:DescribeMitigationAction,
iot:TagResource,
iam:PassRole
Read
iot:DescribeMitigationAction,
iot:ListTagsForResource
Update
iot:UpdateMitigationAction,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource,
iam:PassRole
Delete
iot:DescribeMitigationAction,
iot:DeleteMitigationAction
List
iot:ListMitigationActions