mitigation_actions
Creates, updates, deletes, gets or lists a mitigation_actions resource.
Overview
| Name | mitigation_actions |
| Type | Resource |
| Id | aws.iot.mitigation_actions |
Fields
The following fields are returned by SELECT queries:
- describe_mitigation_action
- list_mitigation_actions
| Name | Datatype | Description |
|---|---|---|
action_arn | string | The ARN that identifies this migration action. |
action_id | string | A unique identifier for this action. |
action_name | string | The friendly name that uniquely identifies the mitigation action. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
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). |
action_type | string | The type of mitigation action. (UPDATE_DEVICE_CERTIFICATE, UPDATE_CA_CERTIFICATE, ADD_THINGS_TO_THING_GROUP, REPLACE_DEFAULT_POLICY_VERSION, ENABLE_IOT_LOGGING, PUBLISH_FINDING_TO_SNS) |
creation_date | string (date-time) | The date and time when the mitigation action was added to your Amazon Web Services accounts. |
last_modified_date | string (date-time) | The date and time when the mitigation action was last changed. |
role_arn | string | The ARN of the IAM role used to apply this action. |
| Name | Datatype | Description |
|---|---|---|
action_arn | string | The IAM role ARN used to apply this mitigation action. |
action_name | string | The friendly name of the mitigation action. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
creation_date | string (date-time) | The date when this mitigation action was created. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_mitigation_action | select | action_name, region | Gets information about a mitigation action. Requires permission to access the DescribeMitigationAction action. | |
list_mitigation_actions | select | region | actionType, maxResults, nextToken | Gets a list of all mitigation actions that match the specified filter criteria. Requires permission to access the ListMitigationActions action. |
create_mitigation_action | insert | action_name, region, roleArn, actionParams | Defines an action that can be applied to audit findings by using StartAuditMitigationActionsTask. Only certain types of mitigation actions can be applied to specific check names. For more information, see Mitigation actions. Each mitigation action can apply only one type of change. Requires permission to access the CreateMitigationAction action. | |
update_mitigation_action | update | action_name, region | Updates the definition for the specified mitigation action. Requires permission to access the UpdateMitigationAction action. | |
delete_mitigation_action | delete | action_name, region | Deletes a defined mitigation action from your Amazon Web Services accounts. Requires permission to access the DeleteMitigationAction action. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
action_name | string | The name of the mitigation action that you want to delete. |
region | string | AWS region (default: us-east-1) |
actionType | string | Specify a value to limit the result to mitigation actions with a specific action type. |
maxResults | integer | The maximum number of results to return at one time. The default is 25. |
nextToken | string | The token for the next set of results. |
SELECT examples
- describe_mitigation_action
- list_mitigation_actions
Gets information about a mitigation action. Requires permission to access the DescribeMitigationAction action.
SELECT
action_arn,
action_id,
action_name,
action_params,
action_type,
creation_date,
last_modified_date,
role_arn
FROM aws.iot.mitigation_actions
WHERE action_name = '{{ action_name }}' -- required
AND region = '{{ region }}' -- required
;
Gets a list of all mitigation actions that match the specified filter criteria. Requires permission to access the ListMitigationActions action.
SELECT
action_arn,
action_name,
creation_date
FROM aws.iot.mitigation_actions
WHERE region = '{{ region }}' -- required
AND actionType = '{{ actionType }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_mitigation_action
- Manifest
Defines an action that can be applied to audit findings by using StartAuditMitigationActionsTask. Only certain types of mitigation actions can be applied to specific check names. For more information, see Mitigation actions. Each mitigation action can apply only one type of change. Requires permission to access the CreateMitigationAction action.
INSERT INTO aws.iot.mitigation_actions (
roleArn,
actionParams,
tags,
action_name,
region
)
SELECT
'{{ roleArn }}' /* required */,
'{{ actionParams }}' /* required */,
'{{ tags }}',
'{{ action_name }}',
'{{ region }}'
RETURNING
action_arn,
action_id
;
# Description fields are for documentation purposes
- name: mitigation_actions
props:
- name: action_name
value: "{{ action_name }}"
description: Required parameter for the mitigation_actions resource.
- name: region
value: "{{ region }}"
description: Required parameter for the mitigation_actions resource.
- name: roleArn
value: "{{ roleArn }}"
- name: actionParams
description: |
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).
value:
updateDeviceCertificateParams:
action: "{{ action }}"
updateCACertificateParams:
action: "{{ action }}"
addThingsToThingGroupParams:
thingGroupNames:
- "{{ thingGroupNames }}"
overrideDynamicGroups: {{ overrideDynamicGroups }}
replaceDefaultPolicyVersionParams:
templateName: "{{ templateName }}"
enableIoTLoggingParams:
roleArnForLogging: "{{ roleArnForLogging }}"
logLevel: "{{ logLevel }}"
publishFindingToSnsParams:
topicArn: "{{ topicArn }}"
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_mitigation_action
Updates the definition for the specified mitigation action. Requires permission to access the UpdateMitigationAction action.
UPDATE aws.iot.mitigation_actions
SET
roleArn = '{{ roleArn }}',
actionParams = '{{ actionParams }}'
WHERE
action_name = '{{ action_name }}' --required
AND region = '{{ region }}' --required
RETURNING
action_arn,
action_id;
DELETE examples
- delete_mitigation_action
Deletes a defined mitigation action from your Amazon Web Services accounts. Requires permission to access the DeleteMitigationAction action.
DELETE FROM aws.iot.mitigation_actions
WHERE action_name = '{{ action_name }}' --required
AND region = '{{ region }}' --required
;